diff options
author | Alexis Reigel <alexis.reigel.ext@siemens.com> | 2018-12-19 17:24:46 +0300 |
---|---|---|
committer | Alexis Reigel <alexis.reigel.ext@siemens.com> | 2019-03-14 20:30:30 +0300 |
commit | 55629a2e4d0237760e1e252f9dbe658f39045156 (patch) | |
tree | e4538625c191d0dbd40192daac90ccb6a9c98918 /app/services/search | |
parent | c36d98501b86e12d03d9a66d3ada9688531f6cd8 (diff) |
add feature flag for users search
Diffstat (limited to 'app/services/search')
-rw-r--r-- | app/services/search/global_service.rb | 3 | ||||
-rw-r--r-- | app/services/search/project_service.rb | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/app/services/search/global_service.rb b/app/services/search/global_service.rb index b19e9f57450..f711839e389 100644 --- a/app/services/search/global_service.rb +++ b/app/services/search/global_service.rb @@ -23,7 +23,8 @@ module Search def allowed_scopes strong_memoize(:allowed_scopes) do - %w[issues merge_requests milestones users] + allowed_scopes = %w[issues merge_requests milestones] + allowed_scopes << 'users' if Feature.enabled?(:users_search, default_enabled: true) end end diff --git a/app/services/search/project_service.rb b/app/services/search/project_service.rb index 0d82c5cd5b2..32d5cd7ddb2 100644 --- a/app/services/search/project_service.rb +++ b/app/services/search/project_service.rb @@ -16,7 +16,12 @@ module Search end def scope - @scope ||= %w[notes issues merge_requests milestones wiki_blobs commits users].delete(params[:scope]) { 'blobs' } + @scope ||= begin + allowed_scopes = %w[notes issues merge_requests milestones wiki_blobs commits] + allowed_scopes << 'users' if Feature.enabled?(:users_search, default_enabled: true) + + allowed_scopes.delete(params[:scope]) { 'blobs' } + end end end end |