Skip to content

Octo-Labs/simple_date_fix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

Gem Version Code Climate

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
# => nil

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

Fixes for date query problems in AWS::Record.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages