summaryrefslogtreecommitdiff
path: root/app/finders/projects_finder.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-01-28 03:15:57 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-01-28 03:15:57 +0000
commitc5f4c801a6b40e7ee4b96aba20bbec687ccf0502 (patch)
treead58e3d5ca9b38d0e86a78143f12362bb35ea1be /app/finders/projects_finder.rb
parent3235221bc498ca3c80eeca505fb32bf9f237778a (diff)
downloadgitlab-ce-c5f4c801a6b40e7ee4b96aba20bbec687ccf0502.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/finders/projects_finder.rb')
-rw-r--r--app/finders/projects_finder.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/finders/projects_finder.rb b/app/finders/projects_finder.rb
index 7245bb36ac9..f6db150c5d8 100644
--- a/app/finders/projects_finder.rb
+++ b/app/finders/projects_finder.rb
@@ -27,6 +27,7 @@
# last_activity_before: datetime
# repository_storage: string
# without_deleted: boolean
+# not_aimed_for_deletion: boolean
#
class ProjectsFinder < UnionFinder
include CustomAttributesFilter
@@ -84,6 +85,7 @@ class ProjectsFinder < UnionFinder
collection = by_archived(collection)
collection = by_custom_attributes(collection)
collection = by_deleted_status(collection)
+ collection = by_not_aimed_for_deletion(collection)
collection = by_last_activity_after(collection)
collection = by_last_activity_before(collection)
by_repository_storage(collection)
@@ -203,6 +205,10 @@ class ProjectsFinder < UnionFinder
params[:without_deleted].present? ? items.without_deleted : items
end
+ def by_not_aimed_for_deletion(items)
+ params[:not_aimed_for_deletion].present? ? items.not_aimed_for_deletion : items
+ end
+
def by_last_activity_after(items)
if params[:last_activity_after].present?
items.where("last_activity_at > ?", params[:last_activity_after]) # rubocop: disable CodeReuse/ActiveRecord