spec/support/document.rb in mongoid-time_range-0.2.0 vs spec/support/document.rb in mongoid-time_range-0.3.0
- old
+ new
@@ -1,5 +1,11 @@
class Document
include Mongoid::Document
field :range, type: Mongoid::TimeRange
end
+
+class DocumentWithDefault
+ include Mongoid::Document
+
+ field :range, type: Mongoid::TimeRange, default: ->{ TimeRange.new }
+end