From b5302d5a820b078b6488104dd695a679e5a49623 Mon Sep 17 00:00:00 2001 From: Dmytro Shteflyuk Date: Thu, 15 Nov 2018 14:49:55 -0500 Subject: Arel: Implemented DB-aware NULL-safe comparison (#34451) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Arel: Implemented DB-aware NULL-safe comparison * Fixed where clause inversion for NULL-safe comparison * Renaming "null_safe_eq" to "is_not_distinct_from", "null_safe_not_eq" to "is_distinct_from" [Dmytro Shteflyuk + Rafael Mendonça França] --- activerecord/lib/arel/nodes/equality.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activerecord/lib/arel/nodes') diff --git a/activerecord/lib/arel/nodes/equality.rb b/activerecord/lib/arel/nodes/equality.rb index 2aa85a977e..551d56c2ff 100644 --- a/activerecord/lib/arel/nodes/equality.rb +++ b/activerecord/lib/arel/nodes/equality.rb @@ -7,5 +7,12 @@ module Arel # :nodoc: all alias :operand1 :left alias :operand2 :right end + + %w{ + IsDistinctFrom + IsNotDistinctFrom + }.each do |name| + const_set name, Class.new(Equality) + end end end -- cgit v1.2.3