Module: ROM::Plugins::Schema::EncryptedAttributes::DSL

Defined in:
lib/rom/plugins/schema/encrypted_attributes.rb

Instance Method Summary collapse

Instance Method Details

#encrypt(*attributes, **opts) ⇒ Object

Examples:

schema do
  use :encrypted_attributes
  encrypt :api_key, :ssn, hash_digest_class: OpenSSL::Digest::SHA256
end


40
41
42
43
44
45
46
# File 'lib/rom/plugins/schema/encrypted_attributes.rb', line 40

def encrypt(*attributes, **opts)
  options = plugin_options(:encrypted_attributes)
  options.merge!(opts)
  options[:attributes] ||= []
  options[:attributes] += attributes
  self
end