flags: disallow flagging pending posts.
This commit is contained in:
@@ -158,6 +158,7 @@ class PostFlag < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def validate_post
|
||||
errors[:post] << "is pending and cannot be flagged" if post.is_pending? && !is_deletion
|
||||
errors[:post] << "is locked and cannot be flagged" if post.is_status_locked?
|
||||
errors[:post] << "is deleted" if post.is_deleted?
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user