2014-02-25 12:15:08 -05:00
|
|
|
# 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'
|
2017-04-25 10:56:32 -04:00
|
|
|
# state: 'open', 'closed', 'merged', or 'all'
|
2014-02-25 12:15:08 -05:00
|
|
|
# group_id: integer
|
|
|
|
# project_id: integer
|
2017-03-31 05:38:40 -04:00
|
|
|
# milestone_title: string
|
2017-07-24 16:07:37 -04:00
|
|
|
# author_id: integer
|
2014-02-25 12:15:08 -05:00
|
|
|
# assignee_id: integer
|
|
|
|
# search: string
|
|
|
|
# label_name: string
|
|
|
|
# sort: string
|
2016-11-27 05:33:15 -05:00
|
|
|
# non_archived: boolean
|
2017-09-03 21:43:14 -04:00
|
|
|
# my_reaction_emoji: string
|
2014-02-25 12:15:08 -05:00
|
|
|
#
|
2014-09-02 08:28:27 -04:00
|
|
|
class MergeRequestsFinder < IssuableFinder
|
2014-02-25 12:15:08 -05:00
|
|
|
def klass
|
|
|
|
MergeRequest
|
|
|
|
end
|
2017-02-07 08:15:07 -05:00
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def item_project_ids(items)
|
|
|
|
items&.reorder(nil)&.select(:target_project_id)
|
|
|
|
end
|
2014-02-25 12:15:08 -05:00
|
|
|
end
|