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'
|
|
|
|
# state: 'open' or 'closed' or 'all'
|
|
|
|
# group_id: integer
|
|
|
|
# project_id: integer
|
|
|
|
# milestone_id: integer
|
|
|
|
# assignee_id: integer
|
|
|
|
# search: string
|
|
|
|
# label_name: string
|
|
|
|
# sort: string
|
2016-11-27 05:33:15 -05:00
|
|
|
# non_archived: boolean
|
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
|
2016-06-27 16:22:19 -04:00
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def iid_pattern
|
|
|
|
@iid_pattern ||= %r{\A[
|
|
|
|
#{Regexp.escape(MergeRequest.reference_prefix)}
|
|
|
|
#{Regexp.escape(Issue.reference_prefix)}
|
|
|
|
](?<iid>\d+)\z
|
|
|
|
}x
|
|
|
|
end
|
2014-02-25 12:15:08 -05:00
|
|
|
end
|