spec/timespan/mongoid/account.rb in timespan-0.2.3 vs spec/timespan/mongoid/account.rb in timespan-0.2.4
- old
+ new
@@ -1,4 +1,10 @@
class Account
include Mongoid::Document
- field :period, :type => ::TimeSpan
+ field :period, :type => TimeSpan
+
+ def self.create_it! duration
+ s = self.new
+ s.period = {duration: duration}
+ s
+ end
end