diff options
author | Francesco Levorato <git@flevour.net> | 2015-09-17 15:44:59 +0200 |
---|---|---|
committer | Francesco Levorato <git@flevour.net> | 2015-09-18 16:37:21 +0200 |
commit | 69cb5fba59a86af0e3311c3ff3e00d0c391797f0 (patch) | |
tree | 114869b5cb60c11c72ca45d41c49e5c8b8d0be0f /app/models/project.rb | |
parent | ac571623d88314c89773ecdb484fc1c4ea92de1a (diff) | |
download | gitlab-ce-69cb5fba59a86af0e3311c3ff3e00d0c391797f0.tar.gz |
Make Project#find_with_namespace case-insensitive
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 6e2f9645661..3b233f2b890 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -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 |