SimpleDateFix
Fixes for date queries using AWS::Record::Model. This gem is based on work done by daniel-nelson in this pull request to the 'aws-sdk' gem. Thanks, Daniel!
Installation
Add this line to your application's Gemfile:
gem 'simple_date_fix'
And then execute:
$ bundle
Or install it yourself as:
$ gem install simple_date_fix
Usage
Now you can query your datetime_attrs.
class Event < AWS::Record::Model
datetime_attr :timestamp
end
e = Event.create!(:timestamp => Time.now - 6.hours)
Event.where("timestamp > ?",Time.now - 7.hours).first
# => e
Event.where("timestamp > ?",Time.now - 5.hours).first
# => nilContributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request