I'm using Rails3, ActiveRecord
Just wondering how can I chain the scopes with OR statements rather than AND.
e.g.
Person.where(:name => "John").where(:lastname => "Smith")
That normally returns:
name = 'John' AND lastname = 'Smith'
but I'd like:
`name = 'John' OR lastname = 'Smith'
You would do
Person.where('name=? OR lastname=?', 'John', 'Smith')
Right now, there isn't any other OR support by the new AR3 syntax (that is without using some 3rd party gem).