diff --git a/activerecord/lib/active_record/encryption/encryptable_record.rb b/activerecord/lib/active_record/encryption/encryptable_record.rb index 5ea045d152ae7..623c03db4bdf2 100644 --- a/activerecord/lib/active_record/encryption/encryptable_record.rb +++ b/activerecord/lib/active_record/encryption/encryptable_record.rb @@ -46,13 +46,11 @@ module EncryptableRecord # * :previous - List of previous encryption schemes. When provided, they will be used in order when trying to read # the attribute. Each entry of the list can contain the properties supported by #encrypts. Also, when deterministic # encryption is used, they will be used to generate additional ciphertexts to check in the queries. - def encrypts(*names, key_provider: nil, key: nil, deterministic: false, support_unencrypted_data: nil, downcase: false, ignore_case: false, previous: [], - compress: true, compressor: nil, **context_properties) + def encrypts(*names, key_provider: nil, key: nil, deterministic: false, support_unencrypted_data: nil, downcase: false, ignore_case: false, previous: [], compress: true, compressor: nil, **context_properties) self.encrypted_attributes ||= Set.new # not using :default because the instance would be shared across classes names.each do |name| - encrypt_attribute name, key_provider: key_provider, key: key, deterministic: deterministic, support_unencrypted_data: support_unencrypted_data, downcase: downcase, ignore_case: ignore_case, previous: previous, - compress: compress, compressor: compressor, **context_properties + encrypt_attribute name, key_provider: key_provider, key: key, deterministic: deterministic, support_unencrypted_data: support_unencrypted_data, downcase: downcase, ignore_case: ignore_case, previous: previous, compress: compress, compressor: compressor, **context_properties end end @@ -83,8 +81,7 @@ def global_previous_schemes_for(scheme) end end - def encrypt_attribute(name, key_provider: nil, key: nil, deterministic: false, support_unencrypted_data: nil, downcase: false, ignore_case: false, previous: [], - compress: true, compressor: nil, **context_properties) + def encrypt_attribute(name, key_provider: nil, key: nil, deterministic: false, support_unencrypted_data: nil, downcase: false, ignore_case: false, previous: [], compress: true, compressor: nil, **context_properties) encrypted_attributes << name.to_sym decorate_attributes([name]) do |name, cast_type|