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:
authorDouwe Maan <douwe@selenight.nl>2017-05-23 04:08:33 +0300
committerDouwe Maan <douwe@selenight.nl>2017-05-24 04:38:35 +0300
commitb0498c176fa134761d899c9b369be12f1ca789c5 (patch)
treedcf223813e0b1bb5932a94793a6f827771517a96 /config/routes/user.rb
parented16c351c5acdf1ad2e401e72490320d06af6e91 (diff)
Remove changes that are not absolutely necessary
Diffstat (limited to 'config/routes/user.rb')
-rw-r--r--config/routes/user.rb28
1 files changed, 14 insertions, 14 deletions
diff --git a/config/routes/user.rb b/config/routes/user.rb
index e682dcd6663..0f3bec9cf58 100644
--- a/config/routes/user.rb
+++ b/config/routes/user.rb
@@ -11,7 +11,19 @@ devise_scope :user do
get '/users/almost_there' => 'confirmations#almost_there'
end
-scope(constraints: { username: Gitlab::PathRegex.root_namespace_route_regex }) do
+constraints(UserUrlConstrainer.new) do
+ # Get all keys of user
+ get ':username.keys' => 'profiles/keys#get_keys', constraints: { username: Gitlab::Regex.root_namespace_route_regex }
+
+ scope(path: ':username',
+ as: :user,
+ constraints: { username: Gitlab::Regex.root_namespace_route_regex },
+ controller: :users) do
+ get '/', action: :show
+ end
+end
+
+scope(constraints: { username: Gitlab::Regex.root_namespace_route_regex }) do
scope(path: 'users/:username',
as: :user,
controller: :users) do
@@ -22,7 +34,7 @@ scope(constraints: { username: Gitlab::PathRegex.root_namespace_route_regex }) d
get :contributed, as: :contributed_projects
get :snippets
get :exists
- get '/', to: redirect('/%{username}'), as: nil
+ get '/', to: redirect('/%{username}')
end
# Compatibility with old routing
@@ -34,15 +46,3 @@ scope(constraints: { username: Gitlab::PathRegex.root_namespace_route_regex }) d
get '/u/:username/snippets', to: redirect('/users/%{username}/snippets')
get '/u/:username/contributed', to: redirect('/users/%{username}/contributed')
end
-
-constraints(UserUrlConstrainer.new) do
- # Get all keys of user
- get ':username.keys' => 'profiles/keys#get_keys', constraints: { username: Gitlab::PathRegex.root_namespace_route_regex }
-
- scope(path: ':username',
- as: :user,
- constraints: { username: Gitlab::PathRegex.root_namespace_route_regex },
- controller: :users) do
- get '/', action: :show
- end
-end