summaryrefslogtreecommitdiff
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-01-30 11:35:28 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-01-30 11:35:28 +0200
commit19700d9278534115003f7abb27157f0546e1d4d1 (patch)
tree2c3b9e78786e46f91896077a731fbd3e2cfd1d5e /app/models/project.rb
parenta6aaa0b443f05ea0db27541f4aef0daa7f6602d4 (diff)
downloadgitlab-ce-dz-nested-groups-improvements-2.tar.gz
Improve search within group logicdz-nested-groups-improvements-2
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index cd35601d76b..80efb8ac792 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -224,6 +224,7 @@ class Project < ActiveRecord::Base
scope :with_project_feature, -> { joins('LEFT JOIN project_features ON projects.id = project_features.project_id') }
scope :with_statistics, -> { includes(:statistics) }
+ scope :inside_path, ->(path) { joins(:route).where('routes.path LIKE ?', "#{path}/%") }
# "enabled" here means "not disabled". It includes private features!
scope :with_feature_enabled, ->(feature) {