Skip to content

Commit c003ed7

Browse files
authored
Merge pull request rails#50655 from Earlopain/enable-lint-safe-navigation-chain
Enable `Lint/SafeNavigationChain` rubocop cop
2 parents 082f269 + 0a9dcb0 commit c003ed7

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,9 @@ Lint/InterpolationCheck:
272272
Exclude:
273273
- '**/test/**/*'
274274

275+
Lint/SafeNavigationChain:
276+
Enabled: true
277+
275278
Style/EvalWithLocation:
276279
Enabled: true
277280
Exclude:

activerecord/lib/active_record/encryption/encryptable_record.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def build_decrypt_attribute_assignments
221221
end
222222

223223
def cant_modify_encrypted_attributes_when_frozen
224-
self.class&.encrypted_attributes.each do |attribute|
224+
self.class.encrypted_attributes.each do |attribute|
225225
errors.add(attribute.to_sym, "can't be modified because it is encrypted") if changed_attributes.include?(attribute)
226226
end
227227
end

0 commit comments

Comments
 (0)