README.md in season-0.0.6 vs README.md in season-0.1
- old
+ new
@@ -1,15 +1,16 @@
# Season
+[![Gem Version](https://badge.fury.io/rb/season.svg)](http://badge.fury.io/rb/season) [![Code Climate](https://codeclimate.com/github/joaodiogocosta/season/badges/gpa.svg)](https://codeclimate.com/github/joaodiogocosta/season) [![Build Status](https://travis-ci.org/joaodiogocosta/season.svg?branch=master)](https://travis-ci.org/joaodiogocosta/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', '~> 0.0.6'
+gem 'season', '~> 0.1'
```
And then execute:
$ bundle
@@ -18,11 +19,11 @@
$ 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.
+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.
@@ -31,13 +32,11 @@
```ruby
# Include it in your models
class User < ActiveRecord::Base
include Season::Scopes
-
...
-
end
# And then use it as:
# (Time/DateTime/String instances are allowed as arguments)
@@ -50,11 +49,10 @@
User.updated_between(Time.now - 1.week, Time.now)
```
They are chainable, so you can also do things like this:
```ruby
-
User.where(id: [1, 2, 3]).created_before(Time.now)
User.updated_after('01-01-2015').order(created_at: :asc)
```
@@ -63,13 +61,11 @@
The scopes are not included by default in your models. To use them you need to include it yourself:
```ruby
class User < ActiveRecord::Base
include Season::Scopes
-
...
-
end
```
If you want them to be available on all of your models by default, add the following code within an initializer - `config/initializers/season.rb`:
@@ -79,14 +75,14 @@
end
```
## To Do
-- Tests!
+- Even more tests
- Support other ORMs (Mongoid, 'insert-more-here')
- Add Error Handling
+- Add helpers for instances (like `User.first.created_before?('01-02-2015')`)
- Support user-defined date/time columns (through configuration)
-- Support configuration for enabling/disabling Season for all models
## Contributing
1. Fork it ( https://github.com/joaodiogocosta/season/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)