Method: ActiveRecord::Encryption::Encryptor#initialize

Defined in:
lib/active_record/encryption/encryptor.rb

#initialize(compress: true, compressor: nil) ⇒ Encryptor

Options

  • :compress - Boolean indicating whether records should be compressed before encryption. Defaults to true.

  • :compressor - The compressor to use.

    1. If compressor is provided, it will be used.

    2. If not, it will use ActiveRecord::Encryption.config.compressor which default value is Zlib.

    If you want to use a custom compressor, it must respond to deflate and inflate.



25
26
27
28
# File 'lib/active_record/encryption/encryptor.rb', line 25

def initialize(compress: true, compressor: nil)
  @compress = compress
  @compressor = compressor || ActiveRecord::Encryption.config.compressor
end