Merge pull request #50655 from Earlopain/enable-lint-safe-navigation-chain

Enable `Lint/SafeNavigationChain` rubocop cop
This commit is contained in:
Rafael Mendonça França 2024-01-08 14:51:18 -05:00 committed by GitHub
commit c003ed7c69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -272,6 +272,9 @@ Lint/InterpolationCheck:
Exclude:
- '**/test/**/*'
Lint/SafeNavigationChain:
Enabled: true
Style/EvalWithLocation:
Enabled: true
Exclude:

View File

@ -221,7 +221,7 @@ module ActiveRecord
end
def cant_modify_encrypted_attributes_when_frozen
self.class&.encrypted_attributes.each do |attribute|
self.class.encrypted_attributes.each do |attribute|
errors.add(attribute.to_sym, "can't be modified because it is encrypted") if changed_attributes.include?(attribute)
end
end