mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 18:39:52 +01:00
BUGFIX Fixes inability to manually subscribe to new questions because there is no subscription record BUGFIX
This commit is contained in:
parent
f6b6bb9c54
commit
33800c9d2a
1 changed files with 5 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue