fix bulk revert
This commit is contained in:
@@ -9,7 +9,7 @@ module Moderator
|
|||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@bulk_revert = BulkRevert.new(@constraints)
|
@bulk_revert = BulkRevert.new
|
||||||
|
|
||||||
if params[:commit] == "Test"
|
if params[:commit] == "Test"
|
||||||
@bulk_revert.preview
|
@bulk_revert.preview
|
||||||
|
|||||||
@@ -4,7 +4,9 @@ class BulkRevert
|
|||||||
|
|
||||||
class ConstraintTooGeneralError < Exception ; end
|
class ConstraintTooGeneralError < Exception ; end
|
||||||
|
|
||||||
def process
|
def process(constraints)
|
||||||
|
@constraints = constraints
|
||||||
|
|
||||||
ModAction.log("#{CurrentUser.name} processed bulk revert for #{constraints.inspect}")
|
ModAction.log("#{CurrentUser.name} processed bulk revert for #{constraints.inspect}")
|
||||||
|
|
||||||
find_post_versions.order("updated_at, id").each do |version|
|
find_post_versions.order("updated_at, id").each do |version|
|
||||||
@@ -12,8 +14,7 @@ class BulkRevert
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def initialize(constraints)
|
def initialize
|
||||||
@constraints = constraints
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def preview
|
def preview
|
||||||
|
|||||||
Reference in New Issue
Block a user