I'm trying to set a default scope so that Users where notified: true
are soft-deleted. notified
is a boolean data column.
This is what I've tried:
class User < ActiveRecord::Base
default_scope { where('notified != ?', true) }
#...
end
But this way, no users appear in any scope. ie - all the users appear to be soft-deleted, even the ones with notified: false
or notified: nil
. What's wrong with my scope?