Chaining scopes with OR #2091
rida-elbahtouri
started this conversation in
General
Replies: 1 comment 1 reply
-
The where(Sequel[assigned_at: Time.zone.now..12.hours.ago] | Sequel[assigned_at: nil]) See https://sequel.jeremyevans.net/rdoc/files/doc/sql_rdoc.html#label-Boolean+Operators+-28AND+OR-29. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
when we have scopes like this
Only the query before
or
will be applied to existing data, and the query after OR seems to be applied on all records, in the above case it will be the equivalent of this:I updated that to this:
this fixed the issue, but I am wondering if there is a better way to handle this.
Beta Was this translation helpful? Give feedback.
All reactions