Skip to content

Commit

Permalink
include creator in bulk revert messages
Browse files Browse the repository at this point in the history
  • Loading branch information
r888888888 committed Nov 16, 2017
1 parent a4c13a7 commit 4e9ebbd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/controllers/moderator/bulk_reverts_controller.rb
Expand Up @@ -15,7 +15,7 @@ def create
@bulk_revert.preview
render action: "new"
else
@bulk_revert.delay(:queue => "default", :priority => 15).process(@constraints)
@bulk_revert.delay(:queue => "default", :priority => 15).process(CurrentUser.user, @constraints)
flash[:notice] = "Reverts queued"
redirect_to new_moderator_bulk_revert_path
end
Expand Down
6 changes: 3 additions & 3 deletions app/logical/bulk_revert.rb
Expand Up @@ -4,12 +4,12 @@ class BulkRevert

class ConstraintTooGeneralError < Exception ; end

def process(constraints)
def process(creator, constraints)
@constraints = constraints

ModAction.log("Processed bulk revert for #{constraints.inspect}")
ModAction.log("Processed bulk revert for #{constraints.inspect} by #{creator.name}")

CurrentUser.scoped(User.system, "127.0.0.1") do
CurrentUser.scoped(creator) do
ActiveRecord::Base.without_timeout do
find_post_versions.order("updated_at, id").each do |version|
version.undo!
Expand Down

0 comments on commit 4e9ebbd

Please sign in to comment.