diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-22 12:16:22 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-22 12:16:22 +0000 |
commit | 96891fec6dfa20a8342a3daa25935213cfddae22 (patch) | |
tree | a09d9a3c565d28b33d0bbc1c1202061c8eb061b9 /app/finders | |
parent | 8bf2e2b73e5898c78dd057e02828b6acc1647a70 (diff) | |
download | gitlab-ce-96891fec6dfa20a8342a3daa25935213cfddae22.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/issues_finder.rb | 6 | ||||
-rw-r--r-- | app/finders/projects/members/effective_access_level_finder.rb | 8 |
2 files changed, 5 insertions, 9 deletions
diff --git a/app/finders/issues_finder.rb b/app/finders/issues_finder.rb index 21a19aa22a1..de750b49c6a 100644 --- a/app/finders/issues_finder.rb +++ b/app/finders/issues_finder.rb @@ -27,7 +27,7 @@ # updated_after: datetime # updated_before: datetime # confidential: boolean -# issue_types: array of strings (one of WorkItem::Type.base_types) +# issue_types: array of strings (one of WorkItems::Type.base_types) # class IssuesFinder < IssuableFinder CONFIDENTIAL_ACCESS_LEVEL = Gitlab::Access::REPORTER @@ -124,13 +124,13 @@ class IssuesFinder < IssuableFinder def by_issue_types(items) issue_type_params = Array(params[:issue_types]).map(&:to_s) return items if issue_type_params.blank? - return Issue.none unless (WorkItem::Type.base_types.keys & issue_type_params).sort == issue_type_params.sort + return Issue.none unless (WorkItems::Type.base_types.keys & issue_type_params).sort == issue_type_params.sort items.with_issue_type(params[:issue_types]) end def by_negated_issue_types(items) - issue_type_params = Array(not_params[:issue_types]).map(&:to_s) & WorkItem::Type.base_types.keys + issue_type_params = Array(not_params[:issue_types]).map(&:to_s) & WorkItems::Type.base_types.keys return items if issue_type_params.blank? items.without_issue_type(issue_type_params) diff --git a/app/finders/projects/members/effective_access_level_finder.rb b/app/finders/projects/members/effective_access_level_finder.rb index d238679f2fb..4538fc4c855 100644 --- a/app/finders/projects/members/effective_access_level_finder.rb +++ b/app/finders/projects/members/effective_access_level_finder.rb @@ -27,13 +27,9 @@ module Projects attr_reader :project def generate_from_statement(user_ids_and_access_levels) - "(VALUES #{generate_values_expression(user_ids_and_access_levels)}) members (user_id, access_level)" - end + values_list = Arel::Nodes::ValuesList.new(user_ids_and_access_levels).to_sql - def generate_values_expression(user_ids_and_access_levels) - user_ids_and_access_levels.map do |user_id, access_level| - "(#{user_id}, #{access_level})" - end.join(",") + "(#{values_list}) members (user_id, access_level)" end def no_members? |