To get all posts with publisher_id
equals to 10, 16, or 17, I do:
Post.where(:publisher_id => [10, 16, 17])
How would I get all posts with publisher_id
not equals to 10, 16, or 17 (i.e. all possible ids besides those three) ?
Just perform a :
Post.where(["publisher_id NOT IN (?)", [10, 16, 17]])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With