Post#expunge!: wrap in transaction.
This commit is contained in:
@@ -1379,9 +1379,11 @@ class Post < ApplicationRecord
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
transaction do
|
||||||
|
Post.without_timeout do
|
||||||
ModAction.log("permanently deleted post ##{id}")
|
ModAction.log("permanently deleted post ##{id}")
|
||||||
delete!("Permanently deleted post ##{id}", :without_mod_action => true)
|
delete!("Permanently deleted post ##{id}", :without_mod_action => true)
|
||||||
Post.without_timeout do
|
|
||||||
give_favorites_to_parent
|
give_favorites_to_parent
|
||||||
update_children_on_destroy
|
update_children_on_destroy
|
||||||
decrement_tag_post_counts
|
decrement_tag_post_counts
|
||||||
@@ -1392,6 +1394,7 @@ class Post < ApplicationRecord
|
|||||||
update_parent_on_destroy
|
update_parent_on_destroy
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def ban!
|
def ban!
|
||||||
update_column(:is_banned, true)
|
update_column(:is_banned, true)
|
||||||
|
|||||||
Reference in New Issue
Block a user