rspec/rules/S2527/description.adoc

5 lines
467 B
Plaintext
Raw Normal View History

2021-01-27 13:42:22 +01:00
In a Zen-like manner, "NULL" is never equal to anything, even itself. Therefore comparisons using equality operators will always return ``++False++``, even when the value actually ``++IS NULL++``.
2020-06-30 12:48:07 +02:00
2021-02-02 15:02:10 +01:00
2021-01-27 13:42:22 +01:00
For that reason, comparison operators should never be used to make comparisons with ``++NULL++``; ``++IS NULL++`` and ``++IS NOT NULL++`` should be used instead. This extends as well to empty string (""), which is equivalent to ``++NULL++`` for some database engines.