Remove complex methods from follow model. Create instance method followed_by? on followable model concern. Some code improvements.
This commit is contained in:
@@ -6,4 +6,8 @@ module Followable
|
||||
has_many :followers, through: :follows, source: :user
|
||||
end
|
||||
|
||||
def followed_by?(user)
|
||||
followers.include?(user)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user