From 33800c9d2a2c98dafa5d09139f7a569e4a4713f7 Mon Sep 17 00:00:00 2001 From: Yuki Date: Tue, 21 Apr 2015 18:32:27 +0530 Subject: [PATCH] BUGFIX Fixes inability to manually subscribe to new questions because there is no subscription record BUGFIX --- app/models/subscription.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/subscription.rb b/app/models/subscription.rb index bd250772..c5065765 100644 --- a/app/models/subscription.rb +++ b/app/models/subscription.rb @@ -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)