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
Ryuta Kamizono 92c1f1499e IsDistinctFrom is not equality node
`IsDistinctFrom` which was added at #34451 is almost same with
`NotEqual`.

Historically subclasses of `Equality` has a special ability, it has
migrated to `equality?` method, so newer class should implement the
method rather than inheriting the `Equality` if want to have an equality
ability, at least `IsDistinctFrom` should not be an equality node
(actually `IsNotDistinctFrom` is almost same with `Equality`, but I'd
not interested to give a special ability to the node which is rarely
used).
2020-06-19 16:37:37 +09:00

15 lines
267 B
Ruby

# frozen_string_literal: true
module Arel # :nodoc: all
module Nodes
class Equality < Arel::Nodes::Binary
include FetchAttribute
def equality?; true; end
def invert
Arel::Nodes::NotEqual.new(left, right)
end
end
end
end