diff options
Diffstat (limited to 'app/controllers/node_actions_controller.rb')
| -rw-r--r-- | app/controllers/node_actions_controller.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/node_actions_controller.rb b/app/controllers/node_actions_controller.rb index 6e46719..9b97b45 100644 --- a/app/controllers/node_actions_controller.rb +++ b/app/controllers/node_actions_controller.rb | |||
| @@ -6,7 +6,11 @@ class NodeActionsController < ApplicationController | |||
| 6 | 6 | ||
| 7 | def index | 7 | def index |
| 8 | @actions = NodeAction.order(:occurred_at => :desc, :id => :desc) | 8 | @actions = NodeAction.order(:occurred_at => :desc, :id => :desc) |
| 9 | @actions = @actions.where(:node_id => params[:node_id]) if params[:node_id].present? | 9 | if params[:node_id].present? |
| 10 | @actions = @actions.joins(:action_participants) | ||
| 11 | .where(:action_participants => { :subject_type => "Node", | ||
| 12 | :subject_id => params[:node_id] }) | ||
| 13 | end | ||
| 10 | @actions = @actions.where(:user_id => params[:user_id]) if params[:user_id].present? | 14 | @actions = @actions.where(:user_id => params[:user_id]) if params[:user_id].present? |
| 11 | @actions = @actions.includes(:node, :user) | 15 | @actions = @actions.includes(:node, :user) |
| 12 | .paginate(:page => params[:page], :per_page => 50) | 16 | .paginate(:page => params[:page], :per_page => 50) |
