3
votes

I have a Member table with a verified boolean flag, and I have a scope that displays all the entries where verified is false, as follows:

scope :not_verified do |members|
  members.where(:verified => false)
end

However, I want my scope to also include entries where verified is null. How do I do that?

1

1 Answers

3
votes
scope :not_verified do |members|
    members.where('verified = ? OR verified IS NULL', false)
end