where
works with scopes the same way it works everywhere else in Rails:
where(:expiry_date => Date.today)
You give it a hash with a key/value. Your way, using ==
, basically invokes where(false)
, as the ==
isn't "passed in", it's resolved instantly (to false as a symbol and date will always be unequal) and the resulting value is passed to where
.