Class: Mongoid::EncryptedDateTime

Inherits:
DateTime
  • Object
show all
Includes:
EncryptedField
Defined in:
lib/mongoid-encrypted-fields/fields/encrypted_date_time.rb

Class Method Summary collapse

Methods included from EncryptedField

#encrypted, #mongoize, #raw_value

Class Method Details

.convert(object) ⇒ Object



27
28
29
# File 'lib/mongoid-encrypted-fields/fields/encrypted_date_time.rb', line 27

def convert(object)
  from_datetime(object.to_datetime)
end

.from_datetime(d) ⇒ Object



23
24
25
# File 'lib/mongoid-encrypted-fields/fields/encrypted_date_time.rb', line 23

def from_datetime(d)
  parse(d.to_s)
end