rails / arel

A Relational Algebra
2.06k stars 390 forks source link

Timestamp between columns, how can i do it? #534

Closed groony closed 6 years ago

groony commented 6 years ago

working example without arel

User.where(':datetime BETWEEN users.started_at AND users.ended_at', datetime: Time.zone.now)

What i want to

table = User.arel_table
User.where(1.day.ago.between(table[:started_at]..table[:ended_at])) 

How can i do it?

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