Module: Mongoid::Encryptor::InstanceMethods

Defined in:
lib/mongoid/encryptor.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#read_attribute_for_validation(key) ⇒ Object

Returns decrypted value for key.

Parameters:

  • key (String)

Returns:

  • (Object)


40
41
42
43
# File 'lib/mongoid/encryptor.rb', line 40

def read_attribute_for_validation(key)
  v = read_attribute(key)
  v.try(:encrypted?) ? v.decrypt : v
end