diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /rubocop/cop/migration/with_lock_retries_with_change.rb | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'rubocop/cop/migration/with_lock_retries_with_change.rb')
-rw-r--r-- | rubocop/cop/migration/with_lock_retries_with_change.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/rubocop/cop/migration/with_lock_retries_with_change.rb b/rubocop/cop/migration/with_lock_retries_with_change.rb index 9d11edcb6a1..59dbd6f22d2 100644 --- a/rubocop/cop/migration/with_lock_retries_with_change.rb +++ b/rubocop/cop/migration/with_lock_retries_with_change.rb @@ -6,7 +6,7 @@ module RuboCop module Cop module Migration # Cop that prevents usage of `with_lock_retries` within the `change` method. - class WithLockRetriesWithChange < RuboCop::Cop::Cop + class WithLockRetriesWithChange < RuboCop::Cop::Base include MigrationHelpers MSG = '`with_lock_retries` cannot be used within `change` so you must manually define ' \ @@ -17,13 +17,9 @@ module RuboCop return unless node.children[1] == :with_lock_retries node.each_ancestor(:def) do |def_node| - add_offense(def_node, location: :name) if method_name(def_node) == :change + add_offense(def_node.loc.name) if def_node.method_name == :change end end - - def method_name(node) - node.children.first - end end end end |