Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues with .where method and ranges #94

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

esmarkowski
Copy link
Member

Was working as expected. range filter works for date ranges and if attribute is a keyword it functions as expected.

Inclusive range forms now adjust the upper bound of the range query:

begin_date = 2.days.ago.beginning_of_day.utc
end_date = 1.day.ago.end_of_day.utc
CrashEvent.where(occurred_on: begin_date..end_date)
# => {filter: [{range: {date: {gte: begin_date, lte: end_date}}}]}

CrashEvent.where(occurred_on: begin_date...end_date)
# => {filter: [{range: {date: {gte: begin_date, lt: end_date}}}]}

Fixes #91

@esmarkowski esmarkowski self-assigned this Mar 20, 2024
@esmarkowski esmarkowski merged commit 26ce013 into main Mar 20, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.where keywords and ranges
1 participant