Sha256: cc33385ff4a97ac50790523ceb0b9364444eb3458f3e2780162dcc6d53916f14

Contents?: true

Size: 399 Bytes

Versions: 6

Compression:

Stored size: 399 Bytes

Contents

module Rasti
  module DB
    module TypeConverters
      class TimeInZone

        class << self

          def to_db(db, collection_name, attribute_name, value)
            value.is_a?(Timing::TimeInZone) ? value.to_time : value
          end

          def from_db(value)
            value.is_a?(Time) ? Timing::TimeInZone.new(value) : value
          end

        end

      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rasti-db-4.2.0 lib/rasti/db/type_converters/time_in_zone.rb
rasti-db-4.1.1 lib/rasti/db/type_converters/time_in_zone.rb
rasti-db-4.1.0 lib/rasti/db/type_converters/time_in_zone.rb
rasti-db-4.0.0 lib/rasti/db/type_converters/time_in_zone.rb
rasti-db-3.0.0 lib/rasti/db/type_converters/time_in_zone.rb
rasti-db-2.3.3 lib/rasti/db/type_converters/time_in_zone.rb