summaryrefslogtreecommitdiff
path: root/app/controllers/dashboard_controller.rb
diff options
context:
space:
mode:
authorrandx <dmitriy.zaporozhets@gmail.com>2012-10-09 22:09:46 +0300
committerrandx <dmitriy.zaporozhets@gmail.com>2012-10-09 22:09:46 +0300
commit679d0d6d760b850e27c13f3ce0f812b8b081df7f (patch)
treee3f088a9139d693e96fd2bd86264150f0d96270c /app/controllers/dashboard_controller.rb
parent63fe042d97a5430770ec50fc0e8f29c416bd2ec9 (diff)
downloadgitlab-ce-679d0d6d760b850e27c13f3ce0f812b8b081df7f.tar.gz
Context refactoring. Move Issues list, Search logic to context
Diffstat (limited to 'app/controllers/dashboard_controller.rb')
-rw-r--r--app/controllers/dashboard_controller.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb
index ee82d0f44db..0ad73f32b5a 100644
--- a/app/controllers/dashboard_controller.rb
+++ b/app/controllers/dashboard_controller.rb
@@ -6,7 +6,7 @@ class DashboardController < ApplicationController
@projects = current_user.projects_with_events
@projects = @projects.page(params[:page]).per(20)
- @events = Event.recent_for_user(current_user).limit(20).offset(params[:offset] || 0)
+ @events = Event.in_projects(current_user.project_ids).limit(20).offset(params[:offset] || 0)
@last_push = current_user.recent_push
respond_to do |format|
@@ -19,14 +19,14 @@ class DashboardController < ApplicationController
# Get authored or assigned open merge requests
def merge_requests
@projects = current_user.projects.all
- @merge_requests = current_user.cared_merge_requests.order("created_at DESC").page(params[:page]).per(20)
+ @merge_requests = current_user.cared_merge_requests.recent.page(params[:page]).per(20)
end
# Get only assigned issues
def issues
@projects = current_user.projects.all
@user = current_user
- @issues = current_user.assigned_issues.opened.order("created_at DESC").page(params[:page]).per(20)
+ @issues = current_user.assigned_issues.opened.recent.page(params[:page]).per(20)
@issues = @issues.includes(:author, :project)
respond_to do |format|