summaryrefslogtreecommitdiff
path: root/app/models/namespace.rb
diff options
context:
space:
mode:
authorJarka Kadlecova <jarka@gitlab.com>2017-03-21 17:04:12 +0100
committerJarka Kadlecova <jarka@gitlab.com>2017-03-21 17:04:12 +0100
commit3750766f425f09439257cbe4934877a17bf815ea (patch)
tree349ff8424facd52ec4e27c081848f99f31608ca6 /app/models/namespace.rb
parent46146e33f2f8dcbd52ee50eb9142887344b8c367 (diff)
downloadgitlab-ce-3750766f425f09439257cbe4934877a17bf815ea.tar.gz
Escape route path for LIKE queries
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r--app/models/namespace.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index d350f1d6770..826ded22ae5 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -195,7 +195,7 @@ class Namespace < ActiveRecord::Base
# Scopes the model on direct and indirect children of the record
def descendants
- self.class.joins(:route).where('routes.path LIKE ?', "#{route.path}/%").reorder('routes.path ASC')
+ self.class.joins(:route).merge(Route.inside_path(route.path)).reorder('routes.path ASC')
end
def user_ids_for_project_authorizations