no longer decrement post counts when post is deleted
This commit is contained in:
@@ -44,6 +44,6 @@ class TagCorrection
|
|||||||
|
|
||||||
def fix!
|
def fix!
|
||||||
tag.delay(:queue => "default").fix_post_count
|
tag.delay(:queue => "default").fix_post_count
|
||||||
Post.expire_cache_for_all(tag.name)
|
Post.expire_cache_for_all([tag.name])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -762,6 +762,7 @@ class Post < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
ModAction.create(:description => "permanently deleted post ##{id}")
|
ModAction.create(:description => "permanently deleted post ##{id}")
|
||||||
|
decrement_tag_post_counts
|
||||||
delete!(:without_mod_action => true)
|
delete!(:without_mod_action => true)
|
||||||
destroy
|
destroy
|
||||||
end
|
end
|
||||||
@@ -779,7 +780,7 @@ class Post < ActiveRecord::Base
|
|||||||
give_favorites_to_parent
|
give_favorites_to_parent
|
||||||
update_children_on_destroy
|
update_children_on_destroy
|
||||||
update_parent_on_destroy
|
update_parent_on_destroy
|
||||||
decrement_tag_post_counts
|
# decrement_tag_post_counts
|
||||||
update_column(:parent_id, nil)
|
update_column(:parent_id, nil)
|
||||||
Post.expire_cache_for_all(tag_array)
|
Post.expire_cache_for_all(tag_array)
|
||||||
|
|
||||||
|
|||||||
@@ -3,5 +3,5 @@
|
|||||||
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment'))
|
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment'))
|
||||||
|
|
||||||
ActiveRecord::Base.connection.execute("set statement_timeout = 0")
|
ActiveRecord::Base.connection.execute("set statement_timeout = 0")
|
||||||
ActiveRecord::Base.connection.execute("update comments set updater_id = creator_id")
|
ActiveRecord::Base.connection.execute("update comments set updater_id = creator_id where updater_id is null")
|
||||||
ActiveRecord::Base.connection.execute("update tags set post_count = 0 where post_count < 0")
|
ActiveRecord::Base.connection.execute("update tags set post_count = 0 where post_count < 0")
|
||||||
|
|||||||
Reference in New Issue
Block a user