summaryrefslogtreecommitdiff
path: root/app/finders
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2016-12-06 14:02:45 +0000
committerSean McGivern <sean@mcgivern.me.uk>2016-12-06 14:02:45 +0000
commite1198d4fe5cc24b6d3ca1368dd2300c9f4351cb5 (patch)
tree894d73dc8629253d02ab6bb3803cf6c65eafc015 /app/finders
parent0ff8f002e2d930490868986e26486fbfb58a377b (diff)
parent4d26ab28a955885cfe8ae08917395cc7fc252ebf (diff)
downloadgitlab-ce-e1198d4fe5cc24b6d3ca1368dd2300c9f4351cb5.tar.gz
Merge branch '24733-archived-project-merge-request-count' into 'master'
Fix Archived project merge requests add to group's Merge Requests Closes #24733 See merge request !7790
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/issuable_finder.rb6
-rw-r--r--app/finders/merge_requests_finder.rb1
2 files changed, 7 insertions, 0 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb
index 9560e9d518e..c9bee01b9ad 100644
--- a/app/finders/issuable_finder.rb
+++ b/app/finders/issuable_finder.rb
@@ -15,6 +15,7 @@
# search: string
# label_name: string
# sort: string
+# non_archived: boolean
#
class IssuableFinder
NONE = '0'
@@ -38,6 +39,7 @@ class IssuableFinder
items = by_author(items)
items = by_label(items)
items = by_due_date(items)
+ items = by_non_archived(items)
sort(items)
end
@@ -356,6 +358,10 @@ class IssuableFinder
end
end
+ def by_non_archived(items)
+ params[:non_archived].present? ? items.non_archived : items
+ end
+
def current_user_related?
params[:scope] == 'created-by-me' || params[:scope] == 'authored' || params[:scope] == 'assigned-to-me'
end
diff --git a/app/finders/merge_requests_finder.rb b/app/finders/merge_requests_finder.rb
index 3b254e7d9d5..8b82255445e 100644
--- a/app/finders/merge_requests_finder.rb
+++ b/app/finders/merge_requests_finder.rb
@@ -14,6 +14,7 @@
# search: string
# label_name: string
# sort: string
+# non_archived: boolean
#
class MergeRequestsFinder < IssuableFinder
def klass