remove reference to currentuser when processing bulk reverts
This commit is contained in:
@@ -7,7 +7,7 @@ class BulkRevert
|
||||
def process(constraints)
|
||||
@constraints = constraints
|
||||
|
||||
ModAction.log("#{CurrentUser.name} processed bulk revert for #{constraints.inspect}")
|
||||
ModAction.log("Processed bulk revert for #{constraints.inspect}")
|
||||
|
||||
find_post_versions.order("updated_at, id").each do |version|
|
||||
version.undo!
|
||||
|
||||
@@ -141,9 +141,12 @@ class Tag < ApplicationRecord
|
||||
Post.with_timeout(30_000, nil, {:tags => name}) do
|
||||
Post.raw_tag_match(name).where("true /* Tag#update_category_post_counts */").find_each do |post|
|
||||
post.reload
|
||||
post.set_tag_counts(false)
|
||||
args = TagCategory.categories.map {|x| ["tag_count_#{x}",post.send("tag_count_#{x}")]}.to_h.update(:tag_count => post.tag_count)
|
||||
Post.where(:id => post.id).update_all(args)
|
||||
# sometimes a post gets expunged
|
||||
if post
|
||||
post.set_tag_counts(false)
|
||||
args = TagCategory.categories.map {|x| ["tag_count_#{x}",post.send("tag_count_#{x}")]}.to_h.update(:tag_count => post.tag_count)
|
||||
Post.where(:id => post.id).update_all(args)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user