diff options
Diffstat (limited to 'app/models/concerns/subscribable.rb')
-rw-r--r-- | app/models/concerns/subscribable.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/app/models/concerns/subscribable.rb b/app/models/concerns/subscribable.rb index 83daa9b1a64..f60a0f8f438 100644 --- a/app/models/concerns/subscribable.rb +++ b/app/models/concerns/subscribable.rb @@ -27,16 +27,16 @@ module Subscribable end def subscribers(project) - subscriptions_available(project). - where(subscribed: true). - map(&:user) + subscriptions_available(project) + .where(subscribed: true) + .map(&:user) end def toggle_subscription(user, project = nil) unsubscribe_from_other_levels(user, project) - find_or_initialize_subscription(user, project). - update(subscribed: !subscribed?(user, project)) + find_or_initialize_subscription(user, project) + .update(subscribed: !subscribed?(user, project)) end def subscribe(user, project = nil) @@ -69,14 +69,14 @@ module Subscribable end def find_or_initialize_subscription(user, project) - subscriptions. - find_or_initialize_by(user_id: user.id, project_id: project.try(:id)) + subscriptions + .find_or_initialize_by(user_id: user.id, project_id: project.try(:id)) end def subscriptions_available(project) t = Subscription.arel_table - subscriptions. - where(t[:project_id].eq(nil).or(t[:project_id].eq(project.try(:id)))) + subscriptions + .where(t[:project_id].eq(nil).or(t[:project_id].eq(project.try(:id)))) end end |