require 'active_record/type' class FionaDateTime < ActiveRecord::Type::Time def type :fiona_datetime end def serialize(value) value.to_iso if value end def deserialize(value) Time.from_iso(value).in_time_zone if value end end