1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/lib/arel/nodes/equality.rb
Dmytro Shteflyuk b5302d5a82 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]
2018-11-15 14:49:55 -05:00

18 lines
341 B
Ruby

# frozen_string_literal: true
module Arel # :nodoc: all
module Nodes
class Equality < Arel::Nodes::Binary
def operator; :== end
alias :operand1 :left
alias :operand2 :right
end
%w{
IsDistinctFrom
IsNotDistinctFrom
}.each do |name|
const_set name, Class.new(Equality)
end
end
end