Fix query for Rails 3 where !=