Module: GovernorComments::Controllers::Methods

Defined in:
lib/governor_comments/controllers/methods.rb

Instance Method Summary collapse

Instance Method Details

#edit_commentsObject



4
5
6
# File 'lib/governor_comments/controllers/methods.rb', line 4

def edit_comments
  @comments = ::Comment.all(:include => [:resource, :commenter])
end

#update_commentsObject



7
8
9
10
11
12
13
14
15
# File 'lib/governor_comments/controllers/methods.rb', line 7

def update_comments
  action = params[:bulk_operation]
  ids = params[:comments].try(:keys) || []
  result = true
  ::Comment.all(:conditions => {:id => ids}).each do |comment|
    result &= comment.send(action)
  end
  redirect_to mapping.plural
end