diff options
-rw-r--r-- | app/models/concerns/routable.rb | 10 | ||||
-rw-r--r-- | changelogs/unreleased/routes-lower-case.yml | 4 |
2 files changed, 10 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 diff --git a/changelogs/unreleased/routes-lower-case.yml b/changelogs/unreleased/routes-lower-case.yml new file mode 100644 index 00000000000..2110956680c --- /dev/null +++ b/changelogs/unreleased/routes-lower-case.yml @@ -0,0 +1,4 @@ +--- +title: Remove repeated routes.path check for postgresql database +merge_request: +author: mhasbini |