This commit is contained in:
r888888888
2013-04-16 20:28:42 -07:00
parent 8696ec8dc2
commit a99f39718d
2 changed files with 12 additions and 2 deletions

View File

@@ -797,6 +797,16 @@ class Post < ActiveRecord::Base
destroy
end
def ban!
update_column(:is_banned, true)
ModAction.create(:description => "banned post ##{id}")
end
def unban!
update_column(:is_banned, false)
ModAction.create(:description => "unbanned post ##{id}")
end
def delete!(options = {})
if is_status_locked?
self.errors.add(:is_status_locked, "; cannot delete post")