need to allow for now scope

This commit is contained in:
Sam Saffron 2016-02-04 00:19:08 +11:00
parent 60ba9dcc5e
commit 3f67f91d27

View file

@ -72,7 +72,7 @@ class CategorySerializer < BasicCategorySerializer
end
def notification_level
user = scope.user
user = scope && scope.user
object.notification_level ||
(user && CategoryUser.where(user: user, category: object).first.try(:notification_level))
end