diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-07-18 15:44:58 -0600 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-07-18 15:44:58 -0600 |
commit | aba558a4a8c7e9e3c691c0e689a0926d4604a26a (patch) | |
tree | 34f75775af7a8cddd6390bf43ba1be00d7f6aa2c /app/services | |
parent | 4b6e6d0ad222e0fbacf300975be961fcbc7bdccd (diff) | |
parent | 36dc4a5ce74dfd76a4acd7580fabec43ede1a254 (diff) | |
download | gitlab-ce-aba558a4a8c7e9e3c691c0e689a0926d4604a26a.tar.gz |
Merge branch 'caironoleto/gitlab-ce-cn-issue-19747'
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/issuable_base_service.rb | 10 | ||||
-rw-r--r-- | app/services/issues/bulk_update_service.rb | 2 |
2 files changed, 11 insertions, 1 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] diff --git a/app/services/issues/bulk_update_service.rb b/app/services/issues/bulk_update_service.rb index cd08c3a0cb9..7e19a73f71a 100644 --- a/app/services/issues/bulk_update_service.rb +++ b/app/services/issues/bulk_update_service.rb @@ -4,7 +4,7 @@ module Issues issues_ids = params.delete(:issues_ids).split(",") issue_params = params - %i(state_event milestone_id assignee_id add_label_ids remove_label_ids).each do |key| + %i(state_event milestone_id assignee_id add_label_ids remove_label_ids subscription_event).each do |key| issue_params.delete(key) unless issue_params[key].present? end |