Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Reigel <mail@koffeinfrei.org>2017-03-15 15:45:28 +0300
committerAlexis Reigel <mail@koffeinfrei.org>2017-04-06 11:01:14 +0300
commit63e61cfd83bdc03d5c0657b5f93c3236d6a2d987 (patch)
treeb4f3cef7e96a9e1bcb4e10d2a61b9ad0598145a8 /app/models/concerns/routable.rb
parent1735ed613910b38c4c069da9c4637bbc4856db36 (diff)
use more explicit and explanatory sql statement
Diffstat (limited to 'app/models/concerns/routable.rb')
-rw-r--r--app/models/concerns/routable.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/concerns/routable.rb b/app/models/concerns/routable.rb
index b907e421743..aca99feee53 100644
--- a/app/models/concerns/routable.rb
+++ b/app/models/concerns/routable.rb
@@ -144,7 +144,9 @@ module Routable
return none if paths.empty?
wheres = paths.map do |path|
- "#{connection.quote(path)} LIKE CONCAT(routes.path, '%')"
+ "#{connection.quote(path)} = routes.path
+ OR
+ #{connection.quote(path)} LIKE CONCAT(routes.path, '/%')"
end
joins(:route).where(wheres.join(' OR '))