Automatically add scopes for day, week, month and year ranges to Active Record models.
Ruby JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
script
test
.gitignore
Gemfile
Gemfile.lock
MIT-LICENSE
README.md
Rakefile
date_range_scopes.gemspec

README.md

DateRangeScopes

Automatically add scopes for day, week, month and year ranges to Active Record models. See date_range_scopes.rb for a full example.

Usage

class User < ActiveRecord::Base
  include DateRangeScopes
end

# => User.created_on
# => User.created_in_week(5.weeks.ago)
# => User.created_in_year