diff options
author | Cairo Noleto <caironoleto@gmail.com> | 2016-07-12 20:18:13 -0300 |
---|---|---|
committer | Cairo Noleto <caironoleto@gmail.com> | 2016-07-14 19:36:19 -0300 |
commit | 36dc4a5ce74dfd76a4acd7580fabec43ede1a254 (patch) | |
tree | 0180131b6b88ea7d27f4675b767b175093bc0cdd /app/services/issuable_base_service.rb | |
parent | acbcbd4a5bb40358fb74dc11fa77abae000b85c9 (diff) | |
download | gitlab-ce-36dc4a5ce74dfd76a4acd7580fabec43ede1a254.tar.gz |
Allow bulk (un)subscription from issues in issue index
fixies #19747
Diffstat (limited to 'app/services/issuable_base_service.rb')
-rw-r--r-- | app/services/issuable_base_service.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/services/issuable_base_service.rb b/app/services/issuable_base_service.rb index e3dc569152c..2d96efe1042 100644 --- a/app/services/issuable_base_service.rb +++ b/app/services/issuable_base_service.rb @@ -101,6 +101,7 @@ class IssuableBaseService < BaseService def update(issuable) change_state(issuable) + change_subscription(issuable) filter_params old_labels = issuable.labels.to_a @@ -124,6 +125,15 @@ class IssuableBaseService < BaseService end end + def change_subscription(issuable) + case params.delete(:subscription_event) + when 'subscribe' + issuable.subscribe(current_user) + when 'unsubscribe' + issuable.unsubscribe(current_user) + end + end + def has_changes?(issuable, old_labels: []) valid_attrs = [:title, :description, :assignee_id, :milestone_id, :target_branch] |