StatusQuerier
gives the ability to safely combine scopes with or
method given by the where-or
gem. It restricts the scopes to the allowable 6 types. pending
, preview
, live
, expired
, invalid
, and disabled
.
Add this line to your application's Gemfile:
gem 'status_querier'
And then execute:
$ bundle
Or install it yourself as:
$ gem install status_querier
To use, copy the following into your model.
include StatusQuerier::Querier
And now you can call Model.with_any_statuses(['preview', 'live'])
After checking out the repo, run bundle
to install dependencies. Then, run rake spec
to run the tests.
Bug reports and pull requests are welcome on GitHub at https://github.com/westfield/status_querier.