Adds User.comment_flags
This commit is contained in:
@@ -9,6 +9,8 @@ class Flag < ActiveRecord::Base
|
||||
flaggable_id: flaggable.id)
|
||||
end)
|
||||
|
||||
scope :for_comments, ->(comments) { where(flaggable_type: 'Comment', flaggable_id: comments) }
|
||||
|
||||
def self.flag(user, flaggable)
|
||||
return false if flagged?(user, flaggable)
|
||||
create(user: user, flaggable: flaggable)
|
||||
|
||||
Reference in New Issue
Block a user