Period for Property.
Uses gem timespan
.
- dates -
Timespan
- flex -
LongDurationRange
See timespan gem for details. Also see specs ;)
Gemfile
gem 'mongoid'
gem 'origin-selectable_ext'
gem 'timespan'
In your model:
class Property
include_concerns :rent_period
end
Note: Currently only supports to be embedded in a Property
model.
TODO: Make relationship polymorphic!
Some API examples
property.dates.duration.total
property.dates = ::Timespan.new duration: 2.weeks
property.subject.flex.min == 3.months
property.start_date == Date.today
property.asap?
Currently, Period
is hardcoded to expect being embedded in Property
. This should be refactored to use a polymorphic relationship in the future!
See LICENCE file.