lib/neo4j/shared/type_converters.rb:64
.call
+ show/hide codedef to_ruby(value) Time.at(value).utc end
def to_ruby(value) Time.at(value).utc end
.convert_type
+ show/hide codedef convert_type Time end
def convert_type Time end
.db_type
+ show/hide codedef db_type Integer end
def db_type Integer end
ActiveAttr, which assists with property management, does not recognize Time as a valid type. We tell it to interpret it as Integer, as it will be when saved to the database.
def primitive_type Integer end
Converts the given DateTime (UTC) value to an Integer. Only utc times are supported !
def to_db(value) if value.class == Date Time.utc(value.year, value.month, value.day, 0, 0, 0).to_i else value.utc.to_i end end
.to_ruby