diff options
Diffstat (limited to 'rubocop/cop/migration/with_lock_retries_disallowed_method.rb')
-rw-r--r-- | rubocop/cop/migration/with_lock_retries_disallowed_method.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/rubocop/cop/migration/with_lock_retries_disallowed_method.rb b/rubocop/cop/migration/with_lock_retries_disallowed_method.rb index b3d05ad1a6d..5c96b38dcdc 100644 --- a/rubocop/cop/migration/with_lock_retries_disallowed_method.rb +++ b/rubocop/cop/migration/with_lock_retries_disallowed_method.rb @@ -5,7 +5,7 @@ require_relative '../../migration_helpers' module RuboCop module Cop module Migration - class WithLockRetriesDisallowedMethod < RuboCop::Cop::Cop + class WithLockRetriesDisallowedMethod < RuboCop::Cop::Base include MigrationHelpers ALLOWED_MIGRATION_METHODS = %i[ @@ -60,8 +60,8 @@ module RuboCop return unless send_node?(node) name = node.children[1] - add_offense(node, location: :expression) unless ALLOWED_MIGRATION_METHODS.include?(name) - add_offense(node, location: :selector, message: MSG_ONLY_ONE_FK_ALLOWED) if multiple_fks?(node) + add_offense(node) unless ALLOWED_MIGRATION_METHODS.include?(name) + add_offense(node.loc.selector, message: MSG_ONLY_ONE_FK_ALLOWED) if multiple_fks?(node) end def multiple_fks?(node) |