method
configure
v7.1.3.2 -
Show latest stable
-
0 notes -
Class: Configurable
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.0
- 6.1.3.1
- 6.1.7.7
- 7.0.0 (0)
- 7.1.3.2 (0)
- 7.1.3.4 (0)
- What's this?
configure(primary_key: nil, deterministic_key: nil, key_derivation_salt: nil, **properties)
public
Hide source
# File activerecord/lib/active_record/encryption/configurable.rb, line 20 def configure(primary_key: nil, deterministic_key: nil, key_derivation_salt: nil, **properties) # :nodoc: config.primary_key = primary_key config.deterministic_key = deterministic_key config.key_derivation_salt = key_derivation_salt # Set the default for this property here instead of in +Config#set_defaults+ as this needs # to happen *after* the keys have been set. properties[:support_sha1_for_non_deterministic_encryption] = true if properties[:support_sha1_for_non_deterministic_encryption].nil? properties.each do |name, value| ActiveRecord::Encryption.config.send "#{name}=", value if ActiveRecord::Encryption.config.respond_to?("#{name}=") end ActiveRecord::Encryption.reset_default_context properties.each do |name, value| ActiveRecord::Encryption.context.send "#{name}=", value if ActiveRecord::Encryption.context.respond_to?("#{name}=") end end