ReneB/activerecord-like — pull request #7 by rzane (2014-11-20 20:27:27+00:00)
Title: where.like should: [ 'accept', 'array' ]

This PR adds the ability to query a field based on multiple search terms. This is especially useful when dealing with multi-word searches. If I type "foo bar" in a search box, I might want to see anything that matches either "foo" or "bar".

```
User.where.like(name: ['%foo%, '%bar%'])
=> SELECT "users".* FROM "users" WHERE (("users"."name" LIKE '%foo%' OR "users"."name" LIKE '%bar%'))

User.where.not_like(name: ['%foo%, '%bar%'])
=> SELECT "users".* FROM "users" WHERE (("users"."name" NOT LIKE '%foo%' AND "users"."name" NOT LIKE '%bar%'))
```

The Arel stuff comes from `matches_any` and `does_not_match_all` from [Arel::Predications](https://github.com/rails/arel/blob/master/lib/arel/predications.rb)

The assumption is made that if you're doing a `like` query, you want to use 'OR'. If you're doing a `not_like` query, you want to use 'AND'. I would think this is most often a safe bet, but maybe it would be a good idea to accept an options hash to override that assumption.