BigW Consortium Gitlab

merge_requests_finder.rb 670 Bytes
Newer Older
1 2 3 4 5 6 7 8
# 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'
9
#     state: 'open', 'closed', 'merged', or 'all'
10 11
#     group_id: integer
#     project_id: integer
12
#     milestone_title: string
13
#     author_id: integer
14 15 16 17
#     assignee_id: integer
#     search: string
#     label_name: string
#     sort: string
18
#     non_archived: boolean
19
#
20
class MergeRequestsFinder < IssuableFinder
21 22 23
  def klass
    MergeRequest
  end
24 25 26 27 28 29

  private

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