diff options
author | mhasbini <mohammad.hasbini@gmail.com> | 2017-03-17 23:26:46 +0200 |
---|---|---|
committer | mhasbini <mohammad.hasbini@gmail.com> | 2017-03-18 12:04:12 +0200 |
commit | 666c20cb705a9e65e2700b1fb0c6bac8f73e827e (patch) | |
tree | 44e67712832e7b15475c93509f8f56a1d8d7abca /app/models/concerns/routable.rb | |
parent | 0eff4f14ccae7d979e6fa20f0bb875e4591351e8 (diff) | |
download | gitlab-ce-666c20cb705a9e65e2700b1fb0c6bac8f73e827e.tar.gz |
Remove repeated routes.path check for postgresql database
Diffstat (limited to 'app/models/concerns/routable.rb')
-rw-r--r-- | app/models/concerns/routable.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/models/concerns/routable.rb b/app/models/concerns/routable.rb index 9f6d215ceb3..529fb5ce988 100644 --- a/app/models/concerns/routable.rb +++ b/app/models/concerns/routable.rb @@ -51,11 +51,13 @@ module Routable paths.each do |path| path = connection.quote(path) - where = "(routes.path = #{path})" - if cast_lower - where = "(#{where} OR (LOWER(routes.path) = LOWER(#{path})))" - end + where = + if cast_lower + "(LOWER(routes.path) = LOWER(#{path}))" + else + "(routes.path = #{path})" + end wheres << where end |