DateConverter

Converts Date objects to Java long types. Must be timezone UTC.

Constants

Methods

.convert_type

def convert_type
  Date
end

.converted?

def converted?(value)
  value.is_a?(db_type)
end

.db_type

def db_type
  Integer
end

.to_db

def to_db(value)
  Time.utc(value.year, value.month, value.day).to_i
end

.to_ruby

def to_ruby(value)
  value.respond_to?(:to_date) ? value.to_date : Time.at(value).utc.to_date
end