Class: ActiveRecord::Encryption::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record/encryption/config.rb

Overview

Container of configuration options

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



11
12
13
# File 'lib/active_record/encryption/config.rb', line 11

def initialize
  set_defaults
end

Instance Attribute Details

#add_to_filter_parametersObject

Returns the value of attribute add_to_filter_parameters.



7
8
9
# File 'lib/active_record/encryption/config.rb', line 7

def add_to_filter_parameters
  @add_to_filter_parameters
end

#deterministic_keyObject

Returns the value of attribute deterministic_key.



7
8
9
# File 'lib/active_record/encryption/config.rb', line 7

def deterministic_key
  @deterministic_key
end

#encrypt_fixturesObject

Returns the value of attribute encrypt_fixtures.



7
8
9
# File 'lib/active_record/encryption/config.rb', line 7

def encrypt_fixtures
  @encrypt_fixtures
end

#excluded_from_filter_parametersObject

Returns the value of attribute excluded_from_filter_parameters.



7
8
9
# File 'lib/active_record/encryption/config.rb', line 7

def excluded_from_filter_parameters
  @excluded_from_filter_parameters
end

#extend_queriesObject

Returns the value of attribute extend_queries.



7
8
9
# File 'lib/active_record/encryption/config.rb', line 7

def extend_queries
  @extend_queries
end

#forced_encoding_for_deterministic_encryptionObject

Returns the value of attribute forced_encoding_for_deterministic_encryption.



7
8
9
# File 'lib/active_record/encryption/config.rb', line 7

def forced_encoding_for_deterministic_encryption
  @forced_encoding_for_deterministic_encryption
end

#key_derivation_saltObject

Returns the value of attribute key_derivation_salt.



7
8
9
# File 'lib/active_record/encryption/config.rb', line 7

def key_derivation_salt
  @key_derivation_salt
end

#previous_schemesObject

Returns the value of attribute previous_schemes.



7
8
9
# File 'lib/active_record/encryption/config.rb', line 7

def previous_schemes
  @previous_schemes
end

#primary_keyObject

Returns the value of attribute primary_key.



7
8
9
# File 'lib/active_record/encryption/config.rb', line 7

def primary_key
  @primary_key
end

#store_key_referencesObject

Returns the value of attribute store_key_references.



7
8
9
# File 'lib/active_record/encryption/config.rb', line 7

def store_key_references
  @store_key_references
end

#support_unencrypted_dataObject

Returns the value of attribute support_unencrypted_data.



7
8
9
# File 'lib/active_record/encryption/config.rb', line 7

def support_unencrypted_data
  @support_unencrypted_data
end

#validate_column_sizeObject

Returns the value of attribute validate_column_size.



7
8
9
# File 'lib/active_record/encryption/config.rb', line 7

def validate_column_size
  @validate_column_size
end

Instance Method Details

#previous=(previous_schemes_properties) ⇒ Object

Configure previous encryption schemes.

config.active_record.encryption.previous = [ { key_provider: MyOldKeyProvider.new } ]


18
19
20
21
22
# File 'lib/active_record/encryption/config.rb', line 18

def previous=(previous_schemes_properties)
  previous_schemes_properties.each do |properties|
    add_previous_scheme(**properties)
  end
end