method

configure

Importance_0
v7.1.3.2 - Show latest stable - 0 notes - Class: Configurable
configure(primary_key: nil, deterministic_key: nil, key_derivation_salt: nil, **properties) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

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
Register or log in to add new notes.