Sha256: 860c911067163cbe1837b06615f54193dee93a2a0e34af1b25281e94afd3c34e

Contents?: true

Size: 249 Bytes

Versions: 9

Compression:

Stored size: 249 Bytes

Contents

require 'active_support/core_ext/time/conversions'
require 'active_support/core_ext/string/conversions'

module MongoModel
  module Types
    class Time < Object
      def cast(value)
        value.to_time.utc rescue nil
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mongomodel-0.2.2 lib/mongomodel/support/types/time.rb
mongomodel-0.2.1 lib/mongomodel/support/types/time.rb
mongomodel-0.2.0 lib/mongomodel/support/types/time.rb
mongomodel-0.1.6 lib/mongomodel/support/types/time.rb
mongomodel-0.1.5 lib/mongomodel/support/types/time.rb
mongomodel-0.1.4 lib/mongomodel/support/types/time.rb
mongomodel-0.1.3 lib/mongomodel/support/types/time.rb
mongomodel-0.1.1 lib/mongomodel/support/types/time.rb
mongomodel-0.1 lib/mongomodel/support/types/time.rb