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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
69cb5fba
Commit
69cb5fba
authored
Sep 17, 2015
by
Francesco Levorato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make Project#find_with_namespace case-insensitive
parent
ac571623
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
app/models/project.rb
app/models/project.rb
+2
-2
spec/models/project_spec.rb
spec/models/project_spec.rb
+1
-0
No files found.
app/models/project.rb
View file @
69cb5fba
...
...
@@ -235,10 +235,10 @@ class Project < ActiveRecord::Base
return
nil
unless
id
.
include?
(
'/'
)
id
=
id
.
split
(
'/'
)
namespace
=
Namespace
.
find_by
(
path:
id
.
first
)
namespace
=
Namespace
.
by_path
(
id
.
first
)
return
nil
unless
namespace
where
(
namespace_id:
namespace
.
id
).
find_by
(
path:
id
.
second
)
where
(
namespace_id:
namespace
.
id
).
where
(
"LOWER(projects.path) = :path"
,
path:
id
.
second
.
downcase
).
first
end
def
visibility_levels
...
...
spec/models/project_spec.rb
View file @
69cb5fba
...
...
@@ -220,6 +220,7 @@ describe Project do
end
it
{
expect
(
Project
.
find_with_namespace
(
'gitlab/gitlabhq'
)).
to
eq
(
@project
)
}
it
{
expect
(
Project
.
find_with_namespace
(
'GitLab/GitlabHQ'
)).
to
eq
(
@project
)
}
it
{
expect
(
Project
.
find_with_namespace
(
'gitlab-ci'
)).
to
be_nil
}
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