summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorMario de la Ossa <mariodelaossa@gmail.com>2018-05-03 15:32:20 -0600
committerMario de la Ossa <mariodelaossa@gmail.com>2018-05-07 12:58:47 -0600
commit02741ca4c58c625070d06c248125b2f510ac2c0b (patch)
tree3bfc7684b2082ee73ceffc85868ef3dc2d307a21 /app/controllers
parent33e78f9ebd35b4132e9f18057f517d92cbefb9cd (diff)
downloadgitlab-ce-02741ca4c58c625070d06c248125b2f510ac2c0b.tar.gz
Backport 5480-epic-notifications from EE
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/sent_notifications_controller.rb20
1 files changed, 12 insertions, 8 deletions
diff --git a/app/controllers/sent_notifications_controller.rb b/app/controllers/sent_notifications_controller.rb
index 04c36b3ebfe..93a71103a09 100644
--- a/app/controllers/sent_notifications_controller.rb
+++ b/app/controllers/sent_notifications_controller.rb
@@ -17,16 +17,20 @@ class SentNotificationsController < ApplicationController
flash[:notice] = "You have been unsubscribed from this thread."
if current_user
- case noteable
- when Issue
- redirect_to issue_path(noteable)
- when MergeRequest
- redirect_to merge_request_path(noteable)
- else
- redirect_to root_path
- end
+ redirect_to noteable_path(noteable)
else
redirect_to new_user_session_path
end
end
+
+ def noteable_path(noteable)
+ case noteable
+ when Issue
+ issue_path(noteable)
+ when MergeRequest
+ merge_request_path(noteable)
+ else
+ root_path
+ end
+ end
end