diff options
author | Michael Kozono <mkozono@gmail.com> | 2017-05-11 13:57:03 -0700 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2017-05-11 15:28:13 -0700 |
commit | ab98f8b5b1fb323ded965cdb352a504525dd0703 (patch) | |
tree | 9cfdb7654d532fd1fd514be8aeaa6c9dbf00faa6 /app/controllers/concerns/routable_actions.rb | |
parent | e7e132529bff3af38175076b84c818b6dea4b05f (diff) | |
download | gitlab-ce-ab98f8b5b1fb323ded965cdb352a504525dd0703.tar.gz |
Fix redirect message for groups and users
Diffstat (limited to 'app/controllers/concerns/routable_actions.rb')
-rw-r--r-- | app/controllers/concerns/routable_actions.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/concerns/routable_actions.rb b/app/controllers/concerns/routable_actions.rb index d4ab6782444..afd110adcad 100644 --- a/app/controllers/concerns/routable_actions.rb +++ b/app/controllers/concerns/routable_actions.rb @@ -4,7 +4,7 @@ module RoutableActions def find_routable!(routable_klass, requested_full_path, extra_authorization_proc: nil) routable = routable_klass.find_by_full_path(requested_full_path, follow_redirects: request.get?) - if routable_authorized?(routable_klass, routable, extra_authorization_proc) + if routable_authorized?(routable, extra_authorization_proc) ensure_canonical_path(routable, requested_full_path) routable else @@ -13,8 +13,8 @@ module RoutableActions end end - def routable_authorized?(routable_klass, routable, extra_authorization_proc) - action = :"read_#{routable_klass.to_s.underscore}" + def routable_authorized?(routable, extra_authorization_proc) + action = :"read_#{routable.class.to_s.underscore}" return false unless can?(current_user, action, routable) if extra_authorization_proc @@ -30,7 +30,7 @@ module RoutableActions canonical_path = routable.full_path if canonical_path != requested_path if canonical_path.casecmp(requested_path) != 0 - flash[:notice] = "Project '#{requested_path}' was moved to '#{canonical_path}'. Please update any links and bookmarks that may still have the old path." + flash[:notice] = "#{routable.class.to_s.titleize} '#{requested_path}' was moved to '#{canonical_path}'. Please update any links and bookmarks that may still have the old path." end redirect_to request.original_url.sub(requested_path, canonical_path) end |