diff options
author | Rémy Coutable <remy@rymai.me> | 2016-03-15 17:24:55 +0100 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-03-15 18:36:54 +0100 |
commit | e90d6ec1d83ff86743e70931b49647eaf3e3e67a (patch) | |
tree | ba66623263b3f060838c4ceb60c1ed8217a1fb86 /app/controllers/concerns | |
parent | c98089b2b29bbcb44cdce7ce23bff3fa5d10d3f3 (diff) | |
download | gitlab-ce-e90d6ec1d83ff86743e70931b49647eaf3e3e67a.tar.gz |
Create a SentNotification record for #relabeled_issue_email / #relabeled_merge_request_email
Diffstat (limited to 'app/controllers/concerns')
-rw-r--r-- | app/controllers/concerns/toggle_subscription_action.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/controllers/concerns/toggle_subscription_action.rb b/app/controllers/concerns/toggle_subscription_action.rb new file mode 100644 index 00000000000..8a43c0b93c4 --- /dev/null +++ b/app/controllers/concerns/toggle_subscription_action.rb @@ -0,0 +1,17 @@ +module ToggleSubscriptionAction + extend ActiveSupport::Concern + + def toggle_subscription + return unless current_user + + subscribable_resource.toggle_subscription(current_user) + + render nothing: true + end + + private + + def subscribable_resource + raise NotImplementedError + end +end |