This commit is contained in:
albert
2013-02-28 09:56:10 -08:00
parent e0f9f1d31a
commit cecf1f67cc

View File

@@ -730,11 +730,12 @@ class Post < ActiveRecord::Base
return false return false
end end
delete! ModAction.create(:description => "permanently deleted post ##{id}")
delete!(:without_mod_action => true)
destroy destroy
end end
def delete! def delete!(options = {})
if is_status_locked? if is_status_locked?
self.errors.add(:is_status_locked, "; cannot delete post") self.errors.add(:is_status_locked, "; cannot delete post")
return false return false
@@ -750,7 +751,10 @@ class Post < ActiveRecord::Base
decrement_tag_post_counts decrement_tag_post_counts
update_column(:parent_id, nil) update_column(:parent_id, nil)
tag_array.each {|x| expire_cache(x)} tag_array.each {|x| expire_cache(x)}
ModAction.create(:description => "deleted post ##{id}")
unless options[:without_mod_action]
ModAction.create(:description => "deleted post ##{id}")
end
end end
end end