Module: Mongoid::Encryptable::ClassMethods
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Extended In:
| |
Defined in: | lib/mongoid/encryptable.rb |
Instance Attribute Summary
-
#encrypted? ⇒ true | false
readonly
Whether the model is encrypted.
Instance Method Summary
-
#encrypt_with(options = {})
::Set
the encryption metadata for the model. -
#set_key_id(key_id)
Internal use only
Internal use only
Override the key_id for the model.
Instance Attribute Details
#encrypted? ⇒ true
| false
(readonly)
Whether the model is encrypted. It means that either the encrypt_with method was called on the model, or at least one of the fields is encrypted.
Instance Method Details
#encrypt_with(options = {})
::Set
the encryption metadata for the model. Parameters set here will be used to encrypt the fields of the model, unless overridden on the field itself.
is deterministic or not.
# File 'lib/mongoid/encryptable.rb', line 27
def encrypt_with( = {}) self. = end
#set_key_id(key_id)
This method is for internal use only.
Override the key_id for the model.
This method is solely for testing purposes and should not be used in the application code. The schema_map is generated very early in the application lifecycle, and overriding the key_id after that will not have any effect.
# File 'lib/mongoid/encryptable.rb', line 48
def set_key_id(key_id) self. [:key_id] = key_id end