diff options
Diffstat (limited to 'app/finders/namespaces/projects_finder.rb')
-rw-r--r-- | app/finders/namespaces/projects_finder.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/finders/namespaces/projects_finder.rb b/app/finders/namespaces/projects_finder.rb index 0194ee40801..6547d41dcdd 100644 --- a/app/finders/namespaces/projects_finder.rb +++ b/app/finders/namespaces/projects_finder.rb @@ -11,6 +11,7 @@ # sort: string # search: string # include_subgroups: boolean +# include_archived: boolean # ids: int[] # with_issues_enabled: boolean # with_merge_requests_enabled: boolean @@ -45,6 +46,7 @@ module Namespaces def filter_projects(collection) collection = by_ids(collection) + collection = by_archived(collection) collection = by_similarity(collection) by_feature_availability(collection) end @@ -55,6 +57,12 @@ module Namespaces items.id_in(params[:ids]) end + def by_archived(items) + return items if Gitlab::Utils.to_boolean(params[:include_archived], default: true) + + items.non_archived + end + def by_similarity(items) return items unless params[:search].present? |