Skip to content
/ scoped Public

A rigid, readable alternative for defining AR scopes.

Notifications You must be signed in to change notification settings

neezer/scoped

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A rigid, readable alternative for defining AR scopes.

Installation

gem install scoped

Usage

require 'scoped'

Then in your ActiveRecord models:

class Meme < ActiveRecord::Base
  include Scoped

  scopes do
    sad_keanu { where(name: 'Keanu Reaves') }
  end
end
Meme.sad_keanu #=> an ActiveRecord::Relation of Memes!

Requirements

Requires ActiveRecord >= 3.1.0, <= 4.1.0, tested with Ruby 1.9.3, 2.0.0, and 2.1.0.

Running Tests

bundle exec rspec

Authors

About

A rigid, readable alternative for defining AR scopes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages