Column Like
Column Like allows you to search using like query in ActiveRecord. It is:
- LightWeight
- Customizable
- Available with every model
Getting started
Column Like works with ActiveRecord 3.0 onwards. You can add it to your Gemfile with:
gem 'column_like'
Run the bundle
command to install it.
After you install Column Like and add it to your Gemfile, you need to run the generator:
rails generate column_like:install
You should restart your application after installing Column Like.
Usage
User.first_name_like('satyam')
User.last_name_like('satyam')
User.email_like('satyam')
User.first_name_like('saty%')
User.first_name_like('s_ty%')
User.first_name_like('%ty%')
User.first_name_like('%ty__')
Bug reports
If you discover a problem with Column Like, I would like to know about it. Send an email to satyam.mgs@gmail.com
Contribute
- Fork it ( http://github.com/SinghSatyam/column_like/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request