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

32 lines
696 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
2022-04-04 11:22:00 +05:30
def attention
strong_memoize(:attention) do
User.find_by_username(params[:attention])
end
end
2021-02-22 17:27:13 +05:30
end
end