aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/where_clause.rb
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/active_record/relation/where_clause.rb
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/active_record/relation/where_clause.rb')
-rw-r--r--activerecord/lib/active_record/relation/where_clause.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/relation/where_clause.rb b/activerecord/lib/active_record/relation/where_clause.rb
index a502713e56..e225628bae 100644
--- a/activerecord/lib/active_record/relation/where_clause.rb
+++ b/activerecord/lib/active_record/relation/where_clause.rb
@@ -125,6 +125,10 @@ module ActiveRecord
raise ArgumentError, "Invalid argument for .where.not(), got nil."
when Arel::Nodes::In
Arel::Nodes::NotIn.new(node.left, node.right)
+ when Arel::Nodes::IsNotDistinctFrom
+ Arel::Nodes::IsDistinctFrom.new(node.left, node.right)
+ when Arel::Nodes::IsDistinctFrom
+ Arel::Nodes::IsNotDistinctFrom.new(node.left, node.right)
when Arel::Nodes::Equality
Arel::Nodes::NotEqual.new(node.left, node.right)
when String