Add SQL "LIKE" clauses as ActiveRecord methods in a config/initializers/ file
You can define ActiveRecord 3 / 4 methods that generate LIKE clauses in your SQL rather than writing out those clauses as strings inside your where() calls. Just in case you can't or don't want to use Squeel or similar.
Gist at http://j.mp/1tyamm8 .
Written by Al Chou
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Tags
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#