Using the .where method in Rails3

Posted by Elliot on Stack Overflow See other posts from Stack Overflow or by Elliot
Published on 2011-01-07T16:45:00Z Indexed on 2011/01/07 16:53 UTC
Read the original article Hit count: 208

Hey Guys,

I've just started using the .where method, and I'm a little bit confused about how to fully utilize it.

I'd like to do something like:

@books = Book.where(:author_id => 1 || 2)

clearly I know that doesn't work, but I'm trying to demonstrate that I want some extra logic here. some "or" "and" "does not equal" etc.

Any ideas for where I can research this? I was looking in the rails API but I didnt see anything that was that helpful.

Thanks!

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby