summaryrefslogtreecommitdiff
path: root/app/controllers/concerns
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-03-15 17:24:55 +0100
committerRémy Coutable <remy@rymai.me>2016-03-15 18:36:54 +0100
commite90d6ec1d83ff86743e70931b49647eaf3e3e67a (patch)
treeba66623263b3f060838c4ceb60c1ed8217a1fb86 /app/controllers/concerns
parentc98089b2b29bbcb44cdce7ce23bff3fa5d10d3f3 (diff)
downloadgitlab-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.rb17
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