Sha256: 4d5e645d6ba9b503eb9472d8f55c8531a0b841b5de80fa6cdb67991e2dd08f98

Contents?: true

Size: 1.4 KB

Versions: 1

Compression:

Stored size: 1.4 KB

Contents

# Season

Season let's you easily query your Models by a specific date/time.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'season'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install season

## Requirements

In this first version Season only supports ActiveRecord, but we plan to also support MongoID in a very short period of time.

## Usage

Season assumes your models have timestamps columns (created_at and updated_at) and uses these to do its magic.

Right now, Season gives you the following helper methods:

```ruby
# You can pass instances of Time/DateTime/String as arguments

MyModel.created_before(Time.now)
MyModel.created_after(DateTime.now)
MyModel.created_between(Time.now - 1.week, '31-01-2015')

MyModel.updated_before(DateTime.now)
MyModel.updated_after('01-01-2015')
MyModel.updated_between(Time.now - 1.week, Time.now)
``` 

## To Do

- Tests!
- Support other ORMs (Mongoid, <insert-more-here>)
- Add Error Handling
- Support user-defined date/time columns (through configuration)
- Support configuration for enabling/disabling Season for all models

## Contributing

1. Fork it ( https://github.com/[my-github-username]/season/fork )
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 a new Pull Request

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
season-0.0.1 README.md