fixes cache error when no user signed in

This commit is contained in:
rgarcia
2015-09-05 22:00:23 +02:00
parent e751c53a5d
commit 7775da6f8d

View File

@@ -22,6 +22,7 @@ class Flag < ActiveRecord::Base
end
def self.flagged?(user, flaggable)
return false unless user
!! by_user_and_flaggable(user, flaggable).try(:first)
end