Sha256: 57ed01e29187a2492bfe506d87384ea75bef30c7e4b5aa65d05410fcb2be07f8

Contents?: true

Size: 392 Bytes

Versions: 2

Compression:

Stored size: 392 Bytes

Contents

class Document
  include Mongoid::Document

  field :range, type: Mongoid::TimeRange
end

class DocumentWithImplicitDefault
  include Mongoid::Document

  field :range, type: Mongoid::TimeRange, default: ->{ { from: Time.now } }
end

class DocumentWithExplicitDefault
  include Mongoid::Document

  field :range, type: Mongoid::TimeRange, default: -> { Mongoid::TimeRange.new(Time.now) }
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mongoid-time_range-0.4.1 spec/support/document.rb
mongoid-time_range-0.4.0 spec/support/document.rb