Sha256: a100a6c05cbbe71efc9460be41ab17455a8edce8f82d6bf08076108140344f52

Contents?: true

Size: 256 Bytes

Versions: 5

Compression:

Stored size: 256 Bytes

Contents

# frozen_string_literal: true

module Kredis
  module Type
    class DateTime < ActiveModel::Type::DateTime
      def serialize(value)
        super&.utc&.iso8601(9)
      end

      def cast_value(value)
        super&.to_time
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
kredis-1.7.0 lib/kredis/type/datetime.rb
kredis-1.6.1 lib/kredis/type/datetime.rb
kredis-1.6.0 lib/kredis/type/datetime.rb
kredis-1.5.0 lib/kredis/type/datetime.rb
kredis-1.4.0 lib/kredis/type/datetime.rb