Post#expunge!: wrap in transaction.
This commit is contained in:
@@ -1379,17 +1379,20 @@ class Post < ApplicationRecord
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
ModAction.log("permanently deleted post ##{id}")
|
transaction do
|
||||||
delete!("Permanently deleted post ##{id}", :without_mod_action => true)
|
Post.without_timeout do
|
||||||
Post.without_timeout do
|
ModAction.log("permanently deleted post ##{id}")
|
||||||
give_favorites_to_parent
|
delete!("Permanently deleted post ##{id}", :without_mod_action => true)
|
||||||
update_children_on_destroy
|
|
||||||
decrement_tag_post_counts
|
give_favorites_to_parent
|
||||||
remove_from_all_pools
|
update_children_on_destroy
|
||||||
remove_from_fav_groups
|
decrement_tag_post_counts
|
||||||
remove_from_favorites
|
remove_from_all_pools
|
||||||
destroy
|
remove_from_fav_groups
|
||||||
update_parent_on_destroy
|
remove_from_favorites
|
||||||
|
destroy
|
||||||
|
update_parent_on_destroy
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user