Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-06-13 03:53:58 +0300
committerRobert Speicher <rspeicher@gmail.com>2015-06-14 00:59:13 +0300
commit8ae13c7a51556a3bd4aa2f0eefc2693972166aa8 (patch)
treef8feb67d9c1553b38966539a9ff3c6237059a17a /app/controllers/root_controller.rb
parentd2894a39e5b3a8504cb290a2f41b0aac5fc8b0a8 (diff)
Refactor RootController
Diffstat (limited to 'app/controllers/root_controller.rb')
-rw-r--r--app/controllers/root_controller.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/app/controllers/root_controller.rb b/app/controllers/root_controller.rb
index 7606d2d0fbe..fdfe00dc135 100644
--- a/app/controllers/root_controller.rb
+++ b/app/controllers/root_controller.rb
@@ -7,12 +7,22 @@
# For users who haven't customized the setting, we simply delegate to
# `DashboardController#show`, which is the default.
class RootController < DashboardController
+ before_action :redirect_to_custom_dashboard, only: [:show]
+
def show
- case current_user.try(:dashboard)
+ super
+ end
+
+ private
+
+ def redirect_to_custom_dashboard
+ return unless current_user
+
+ case current_user.dashboard
when 'stars'
redirect_to starred_dashboard_projects_path
else
- super
+ return
end
end
end