NoBrainerORM / nobrainer

Ruby ORM for RethinkDB
http://nobrainer.io/
Other
387 stars 49 forks source link

Implements during ReQL command #269

Closed zedtux closed 3 years ago

zedtux commented 3 years ago

This PR implements the during ReQL command which allow to filter documents having the given filed between the 2 given times.

Here is an example of its usage:

User.where(:created_at.during(1.month.ago, Time.current)).to_a

It returns all the created Users in the last month period of time.

It replaces using the combinaison of gt and lt.

zedtux commented 3 years ago

There's an issue with type casting so please wait before to more this one. Sorry about that.

zedtux commented 3 years ago

@nviennot I fixed your review and added the TimeWithZone support for during.

When you'll have accepted it, I can submit a PR to update the doc if you'd like to 😉