BUGFIX Fixes inability to manually subscribe to new questions because there is no subscription record BUGFIX

This commit is contained in:
Yuki 2015-04-21 18:32:27 +05:30
parent f6b6bb9c54
commit 33800c9d2a

View file

@ -9,7 +9,11 @@ class Subscription < ActiveRecord::Base
def is_subscribed(recipient, target)
existing = Subscription.find_by(user: recipient, answer: target)
existing.nil? or existing.is_active
if existing.nil?
false
else
existing.is_active
end
end
def subscribe(recipient, target, force = true)