lib/socialcastr/message.rb in socialcastr-0.2.13 vs lib/socialcastr/message.rb in socialcastr-0.2.14
- old
+ new
@@ -27,9 +27,10 @@
return false if self.user.id == api_id
like_for(api_id).nil?
end
def like_for(api_id)
+ return nil if (self.likes.nil? || self.likes.empty?)
self.likes.select { |like| like.unlikable_by?(api_id) }.first
end
def unlike!
self.likes.reject! do |l|