flags: move status locked check to post_flag.rb.

This commit is contained in:
evazion
2017-05-04 14:58:03 -05:00
parent b6e1958917
commit 9f64857719
2 changed files with 4 additions and 9 deletions

View File

@@ -296,10 +296,6 @@ class Post < ActiveRecord::Base
end
def flag!(reason, options = {})
if is_status_locked?
raise PostFlag::Error.new("Post is locked and cannot be flagged")
end
flag = flags.create(:reason => reason, :is_resolved => false, :is_deletion => options[:is_deletion])
if flag.errors.any?