From b4e56822c72db54ba338940e2517a4e25e2159a6 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 31 Mar 2025 10:08:02 -0400 Subject: [PATCH] Fix `Style/MapToHash` cop (#34327) --- .rubocop_todo.yml | 7 +------ app/models/status.rb | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 1678272c7b..f63a3ebf39 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --auto-gen-only-exclude --no-offense-counts --no-auto-gen-timestamp` -# using RuboCop version 1.75.0. +# using RuboCop version 1.75.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -64,11 +64,6 @@ Style/HashTransformValues: - 'app/serializers/rest/web_push_subscription_serializer.rb' - 'app/services/import_service.rb' -# This cop supports unsafe autocorrection (--autocorrect-all). -Style/MapToHash: - Exclude: - - 'app/models/status.rb' - # Configuration parameters: AllowedMethods. # AllowedMethods: respond_to_missing? Style/OptionalBooleanParameter: diff --git a/app/models/status.rb b/app/models/status.rb index 746fcde395..cdff5a2ac3 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -342,7 +342,7 @@ class Status < ApplicationRecord end def bookmarks_map(status_ids, account_id) - Bookmark.select(:status_id).where(status_id: status_ids).where(account_id: account_id).map { |f| [f.status_id, true] }.to_h + Bookmark.select(:status_id).where(status_id: status_ids).where(account_id: account_id).to_h { |f| [f.status_id, true] } end def reblogs_map(status_ids, account_id)