Skip to content

Commit 4330bbe

Browse files
committed
No need to call tap since replace_serialized_subtype returns the callee.
1 parent 9c83900 commit 4330bbe

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

activerecord/lib/active_record/encryption/encryptable_record.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,8 @@ def encrypt_attribute(name, key_provider: nil, key: nil, deterministic: false, s
9191
type_options = { scheme: scheme, default: columns_hash[name.to_s]&.default }
9292

9393
if cast_type.serialized?
94-
cast_type.tap do |serialized_type|
95-
serialized_type.replace_serialized_subtype do |current_subtype|
96-
ActiveRecord::Encryption::EncryptedAttributeType.new(cast_type: current_subtype, **type_options)
97-
end
94+
cast_type.replace_serialized_subtype do |current_subtype|
95+
ActiveRecord::Encryption::EncryptedAttributeType.new(cast_type: current_subtype, **type_options)
9896
end
9997
else
10098
ActiveRecord::Encryption::EncryptedAttributeType.new(cast_type: cast_type, **type_options)

0 commit comments

Comments
 (0)