README.md in mongoid-time_range-0.3.0 vs README.md in mongoid-time_range-0.4.0
- old
+ new
@@ -1,8 +1,8 @@
# mongoid-time_range
-Mongoid::TimeRange defines a TimeRange type for your Mongoid apps, which is an object with `from` and `to` keys.
+`Mongoid::TimeRange` defines a time range type for your Mongoid apps, which is stored internally as a hash with `from` and `to` keys.
## Installation
In your Gemfile:
@@ -19,12 +19,9 @@
field :range, type: Mongoid::TimeRange
end
```
```ruby
-document = Document.create
-document.range # => { from: 2013-01-01 00:00:00 +0100, to: nil }
-
year2013 = Document.create(range: { from: Time.now.at_beginning_of_year, to: Time.now.end_of_year })
year2013.range # => { from: 2013-01-01 00:00:00 +0100, to: 2013-12-31 23:59:59 +0100 }
```
If you want to use `TimeRange` directly instead of `Mongoid::TimeRange`: