Blog Me think, why waste time say lot word, when few word do trick

PostgreSQL’s IS DISTINCT FROM.

Sometimes you need to find records which field is not equal to given value or is NULL. And instead of writing something like:

User.where('email != ? OR email IS NULL', 'test@example.com')

you can use pretty handy PostgreSQL’s IS DISTINCT FROM comparison operator:

User.where('email IS DISTINCT FROM ?', 'test@example.com')