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
Boxiang Sun
gitlab-ce
Commits
e1c245af
Commit
e1c245af
authored
May 05, 2017
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve discussions
parent
f05469f9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
app/controllers/projects/application_controller.rb
app/controllers/projects/application_controller.rb
+5
-6
app/models/route.rb
app/models/route.rb
+1
-1
No files found.
app/controllers/projects/application_controller.rb
View file @
e1c245af
...
...
@@ -21,13 +21,12 @@ class Projects::ApplicationController < ApplicationController
end
def
project
@project
||=
find_routable!
(
Project
,
File
.
join
(
params
[
:namespace_id
],
params
[
:project_id
]
||
params
[
:id
]),
extra_authorization_proc:
project_not_being_deleted?
)
end
return
@project
if
@project
path
=
File
.
join
(
params
[
:namespace_id
],
params
[
:project_id
]
||
params
[
:id
]
)
auth_proc
=
->
(
project
)
{
!
project
.
pending_delete?
}
def
project_not_being_deleted?
->
(
project
)
{
!
project
.
pending_delete?
}
@project
=
find_routable!
(
Project
,
path
,
extra_authorization_proc:
auth_proc
)
end
def
repository
...
...
app/models/route.rb
View file @
e1c245af
...
...
@@ -16,7 +16,7 @@ class Route < ActiveRecord::Base
scope
:direct_descendant_routes
,
->
(
path
)
{
where
(
'routes.path LIKE ? AND routes.path NOT LIKE ?'
,
"
#{
sanitize_sql_like
(
path
)
}
/%"
,
"
#{
sanitize_sql_like
(
path
)
}
/%/%"
)
}
def
rename_direct_descendant_routes
return
if
!
path_changed?
&&
!
name_changed?
return
unless
path_changed?
||
name_changed?
direct_descendant_routes
=
self
.
class
.
direct_descendant_routes
(
path_was
)
...
...
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