debian-mirror-gitlab/app/finders/merge_requests_finder/params.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
573 B
Ruby
Raw Normal View History

2021-02-22 17:27:13 +05:30
# frozen_string_literal: true
class MergeRequestsFinder
class Params < IssuableFinder::Params
def filter_by_no_reviewer?
params[:reviewer_id].to_s.downcase == FILTER_NONE
end
def filter_by_any_reviewer?
params[:reviewer_id].to_s.downcase == FILTER_ANY
end
def reviewer
strong_memoize(:reviewer) do
if reviewer_id?
User.find_by_id(params[:reviewer_id])
elsif reviewer_username?
User.find_by_username(params[:reviewer_username])
else
nil
end
end
end
end
end