lib/socialcastr/comment.rb in socialcastr-0.2.12 vs lib/socialcastr/comment.rb in socialcastr-0.2.13
- old
+ new
@@ -15,13 +15,14 @@
def unlikable_by?(api_id)
self.likes.map{|l| l.unlikable_by?(api_id)}.any?
end
def likable_by?(api_id)
- self.user.id != api_id
+ return false if self.user.id == api_id
+ like_for(api_id).nil?
end
- def like
- self.likes.select { |like| like.unlikable_by?(api.profile.id) }.first
+ def like_for(api_id)
+ self.likes.select { |like| like.unlikable_by?(api_id) }.first
end
end
end