oelmekki/activerecord_any_of — pull request #14 by oelmekki (2013-11-03 13:05:36+00:00)
Title: REFACTOR handle implicit hash parameters as expected

There was a lot of confusion about explit/implicit hash parameter notation,
with people expecting this to generate an OR query :

User.where.any_of(name: 'Doe', active: true)

This wouldn't work, since there is only one parameter, here : `{name: 'Doe', active: true}`,
so there's a single group of condition that is joined as a AND. To achieve
expected result, this should have been used :

User.where.any_of({name: 'Doe'}, {active: true})

To be true to principle of least surprise, we now automatically expand
parameters consisting of a single Hash as a hash for each key, so first
query will indeed generate :

User.where.any_of(name: 'Doe', active: true)
# => SELECT * FROM users WHERE name = 'Doe' OR active = '1'

Grouping conditions can still be achieved using explicit curly brackets :

User.where.any_of({first_name: 'John', last_name: 'Doe'}, active: true)
# => SELECT * FROM users WHERE (first_name = 'John' AND last_name = 'Doe') OR active = '1'

Fix #13