Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 735 Bytes

README.md

File metadata and controls

36 lines (27 loc) · 735 Bytes

Filters

This is a helper class to translate a string of filters into usable sql to modify active record queries.

Example query:

  • ?filters=status==verified,age>18,weight>=<150;200

This query translates to:

  • WHERE status = 'verified'
  • AND age > 18
  • AND weight BETWEEN 150 AND 200

Usage

See the tests for usage and examples /spec/filters_spec.rb

Installation

Add this line to your application's Gemfile:

gem 'filters'

And then execute:

$ bundle

Or install it yourself as:

$ gem install filters

License

The gem is available as open source under the terms of the MIT License.