pguardiario
pguardiario

Reputation: 54984

active record where method and not

I can't seem to find the answer to this anywhere. I know I can do:

Item.where(:color => 'red')

to get all red items, but how do I get all items whose color is not red?

Upvotes: 3

Views: 111

Answers (1)

Jesse Wolgamott
Jesse Wolgamott

Reputation: 40277

It's a mix of the old school format and the new Arel format.

Item.where("color != ?", 'red')

Upvotes: 5

Related Questions