Permalink
Browse files

include creator in bulk revert messages

  • Loading branch information...
r888888888 committed Nov 16, 2017
1 parent a4c13a7 commit 4e9ebbd02e875e3a008e3bc359f439be8419b3b6
Showing with 4 additions and 4 deletions.
  1. +1 −1 app/controllers/moderator/bulk_reverts_controller.rb
  2. +3 −3 app/logical/bulk_revert.rb
@@ -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
@@ -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!

0 comments on commit 4e9ebbd

Please sign in to comment.