diff options
Diffstat (limited to 'app/controllers/admin_controller.rb')
| -rw-r--r-- | app/controllers/admin_controller.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index d9cf1be6..2b35fd20 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb | |||
| @@ -5,7 +5,9 @@ class AdminController < ApplicationController | |||
| 5 | before_action :login_required | 5 | before_action :login_required |
| 6 | 6 | ||
| 7 | def index | 7 | def index |
| 8 | @drafts = Node.drafts_and_autosaves(current_user_id: current_user.id).limit(5) | 8 | scope = Node.work_in_progress(current_user_id: current_user.id) |
| 9 | @drafts_total = scope.reorder(nil).count | ||
| 10 | @drafts = scope.includes(:head, :draft, :lock_owner).limit(5) | ||
| 9 | @actions = NodeAction.order(:occurred_at => :desc, :id => :desc).limit(5) | 11 | @actions = NodeAction.order(:occurred_at => :desc, :id => :desc).limit(5) |
| 10 | end | 12 | end |
| 11 | 13 | ||
