mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-03-03 05:33:03 +01:00
Merge pull request #12 from skiprope/subscriptions
Fixes inability to manually subscribe to new questions because there is no subscription record
This commit is contained in:
commit
cfbed77fa3
1 changed files with 5 additions and 1 deletions
|
@ -9,7 +9,11 @@ class Subscription < ActiveRecord::Base
|
||||||
|
|
||||||
def is_subscribed(recipient, target)
|
def is_subscribed(recipient, target)
|
||||||
existing = Subscription.find_by(user: recipient, answer: 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
|
end
|
||||||
|
|
||||||
def subscribe(recipient, target, force = true)
|
def subscribe(recipient, target, force = true)
|
||||||
|
|
Loading…
Reference in a new issue