aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/arel/nodes
diff options
context:
space:
mode:
authorDmytro Shteflyuk <kpumuk@kpumuk.info>2018-11-15 14:49:55 -0500
committerRafael França <rafaelmfranca@gmail.com>2018-11-15 14:49:55 -0500
commitb5302d5a820b078b6488104dd695a679e5a49623 (patch)
treea8f393036fd1b72c33d9ed448f6ada379b2dd429 /activerecord/lib/arel/nodes
parentd1c76dd4b0d308db432afb56c7dafcbefbf4ee3a (diff)
downloadrails-b5302d5a820b078b6488104dd695a679e5a49623.tar.gz
rails-b5302d5a820b078b6488104dd695a679e5a49623.tar.bz2
rails-b5302d5a820b078b6488104dd695a679e5a49623.zip
Arel: Implemented DB-aware NULL-safe comparison (#34451)
* 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]
Diffstat (limited to 'activerecord/lib/arel/nodes')
-rw-r--r--activerecord/lib/arel/nodes/equality.rb7
1 files changed, 7 insertions, 0 deletions
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