From a2bcfeb887a0ae1d437bb727333d769a8248b578 Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 4 Dec 2023 10:09:43 +0100 Subject: [PATCH] Fix `Style/HashEachMethods` cop in HAML files (#28178) --- app/views/admin/reports/index.html.haml | 2 +- app/views/settings/applications/_fields.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/admin/reports/index.html.haml b/app/views/admin/reports/index.html.haml index e94847d674..e2a9868aa5 100644 --- a/app/views/admin/reports/index.html.haml +++ b/app/views/admin/reports/index.html.haml @@ -27,7 +27,7 @@ %button.button= t('admin.accounts.search') = link_to t('admin.accounts.reset'), admin_reports_path, class: 'button negative' -- @reports.group_by(&:target_account_id).each do |_target_account_id, reports| +- @reports.group_by(&:target_account_id).each_value do |reports| - target_account = reports.first.target_account .report-card .report-card__profile diff --git a/app/views/settings/applications/_fields.html.haml b/app/views/settings/applications/_fields.html.haml index 4f5077d831..29e2bcb5a3 100644 --- a/app/views/settings/applications/_fields.html.haml +++ b/app/views/settings/applications/_fields.html.haml @@ -14,5 +14,5 @@ %label= t('activerecord.attributes.doorkeeper/application.scopes') %span.hint= t('simple_form.hints.defaults.scopes') - - Doorkeeper.configuration.scopes.group_by { |s| s.split(':').first }.each do |_key, value| + - Doorkeeper.configuration.scopes.group_by { |s| s.split(':').first }.each_value do |value| = f.input :scopes, label: false, hint: false, collection: value.sort, wrapper: :with_block_label, include_blank: false, label_method: ->(scope) { safe_join([content_tag(:samp, scope, class: class_for_scope(scope)), content_tag(:span, t("doorkeeper.scopes.#{scope}"), class: 'hint')]) }, selected: f.object.scopes.all, required: false, as: :check_boxes, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li'