Skip to content

Conversation

kamipo
Copy link
Member

@kamipo kamipo commented Jun 19, 2020

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).

`IsDistinctFrom` which was added at rails#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).
@kamipo kamipo merged commit dde9e82 into rails:master Jun 19, 2020
@kamipo kamipo deleted the is_distinct_from_is_not_equality branch June 19, 2020 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant