From a38f67c1c3f3c05bcbf552aad2f7f931fa0a4286 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Wed, 15 Mar 2023 20:36:37 -0400 Subject: [PATCH] Autofix Rubocop Style/PreferredHashMethods (#23851) --- .rubocop_todo.yml | 8 -------- spec/support/matchers/model/model_have_error_on_field.rb | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 8a96e59f907..0921d4f7317 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -2050,14 +2050,6 @@ Style/OptionalBooleanParameter: - 'app/workers/unfollow_follow_worker.rb' - 'lib/mastodon/redis_config.rb' -# Offense count: 1 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: short, verbose -Style/PreferredHashMethods: - Exclude: - - 'spec/support/matchers/model/model_have_error_on_field.rb' - # Offense count: 5 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Methods. diff --git a/spec/support/matchers/model/model_have_error_on_field.rb b/spec/support/matchers/model/model_have_error_on_field.rb index 21632b5748f..0f9c81a475a 100644 --- a/spec/support/matchers/model/model_have_error_on_field.rb +++ b/spec/support/matchers/model/model_have_error_on_field.rb @@ -4,7 +4,7 @@ RSpec::Matchers.define :model_have_error_on_field do |expected| match do |record| record.valid? if record.errors.empty? - record.errors.has_key?(expected) + record.errors.key?(expected) end failure_message do |record|