Skip to content

Commit

Permalink
use node.identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
j-miyake committed Feb 25, 2022
1 parent 8044249 commit 16787cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rubocop/cop/rails/migration_class_name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def on_class(node)
corrected_class_name = to_camelcase(basename_without_timestamp)
message = format(MSG, corrected_class_name: corrected_class_name)

add_offense(node.loc.name, message: message) do |corrector|
corrector.replace(node.loc.name, corrected_class_name)
add_offense(node.identifier, message: message) do |corrector|
corrector.replace(node.identifier, corrected_class_name)
end
end

Expand Down

0 comments on commit 16787cf

Please sign in to comment.