mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
92c1f1499e
`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).
15 lines
267 B
Ruby
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
|