Module: Likeable

Extended by:
ActiveSupport::Concern
Included in:
Reply, Topic
Defined in:
app/models/concerns/likeable.rb

Instance Method Summary collapse

Instance Method Details

#liked_by_user?(user) ⇒ Boolean

Returns:

  • (Boolean)

7
8
9
10
# File 'app/models/concerns/likeable.rb', line 7

def liked_by_user?(user)
  return false if user.blank?
  liked_user_ids.include?(user.id)
end