Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
ca5c762c
Commit
ca5c762c
authored
May 03, 2017
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor
parent
72872ee2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
app/controllers/users_controller.rb
app/controllers/users_controller.rb
+3
-5
app/models/route.rb
app/models/route.rb
+6
-4
No files found.
app/controllers/users_controller.rb
View file @
ca5c762c
...
@@ -94,11 +94,9 @@ class UsersController < ApplicationController
...
@@ -94,11 +94,9 @@ class UsersController < ApplicationController
private
private
def
authorize_read_user!
def
authorize_read_user!
if
can?
(
current_user
,
:read_user
,
user
)
render_404
unless
can?
(
current_user
,
:read_user
,
user
)
ensure_canonical_path
(
user
.
namespace
,
params
[
:username
])
else
ensure_canonical_path
(
user
.
namespace
,
params
[
:username
])
render_404
end
end
end
def
user
def
user
...
...
app/models/route.rb
View file @
ca5c762c
...
@@ -43,11 +43,13 @@ class Route < ActiveRecord::Base
...
@@ -43,11 +43,13 @@ class Route < ActiveRecord::Base
RedirectRoute
.
matching_path_and_descendants
(
path
)
RedirectRoute
.
matching_path_and_descendants
(
path
)
end
end
def
create_redirect_for_old_path
create_redirect
(
path_was
)
if
path_changed?
end
def
create_redirect
(
path
)
def
create_redirect
(
path
)
RedirectRoute
.
create
(
source:
source
,
path:
path
)
RedirectRoute
.
create
(
source:
source
,
path:
path
)
end
end
private
def
create_redirect_for_old_path
create_redirect
(
path_was
)
if
path_changed?
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment