rails / arel

A Relational Algebra
2.06k stars 390 forks source link

Why is `Arel::Nodes::Or.neq` different from `Arel::Nodes::And.new`? #533

Closed jonas-schulze closed 6 years ago

jonas-schulze commented 6 years ago

The following code is totally fine:

users = Arel::Table.new(:users)
sub_clauses = [
  users[:name].eq 'Chuck Norris',
  users[:age].eq 42,
]
Arel::Nodes::And.new sub_clauses

Substitute And for Or and it no longer is. To get a proper Or you have to sub_clauses.reduce(:or). Why do they behave differently?

rafaelfranca commented 6 years ago

Not sure. Please do investigate. Maybe there is no reason and we just to implement.

matthewd commented 6 years ago

Per #523, Arel development is moving to rails/rails.

If this issue is still relevant, please consider reopening it over there. (Note that the Rails repository does not accept feature request issues, and requires reproduction steps that rely on Active Record's documented API.)