summaryrefslogtreecommitdiff
path: root/app/finders/merge_requests_finder.rb
blob: 771da3d441d05f2ec3e90d723dbd35ec21ff1d07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Finders::MergeRequest class
#
# Used to filter MergeRequests collections by set of params
#
# Arguments:
#   current_user - which user use
#   params:
#     scope: 'created-by-me' or 'assigned-to-me' or 'all'
#     state: 'open', 'closed', 'merged', or 'all'
#     group_id: integer
#     project_id: integer
#     milestone_title: string
#     author_id: integer
#     assignee_id: integer
#     search: string
#     label_name: string
#     sort: string
#     non_archived: boolean
#
class MergeRequestsFinder < IssuableFinder
  def klass
    MergeRequest
  end

  private

  def item_project_ids(items)
    items&.reorder(nil)&.select(:target_project_id)
  end
end