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

before(nil) and after(nil) #82

Open
zacharywelch opened this issue Mar 13, 2019 · 2 comments
Open

before(nil) and after(nil) #82

zacharywelch opened this issue Mar 13, 2019 · 2 comments

Comments

@zacharywelch
Copy link
Contributor

Similar to #60 and #63, wondering if there's a way for .before and .after to return scope (do nothing) when the argument is nil, similar to .between_times.

between_times(start_time, nil) - same as after(start_time)
between_times(nil, end_time) - same as before(end_time)

Current behavior is to default base and time range scopes to Time.zone.now, but would prefer that only apply to the time range scopes 😅

Current behavior

Event.after(nil) #=> returns all events after the current time 

Desired behavior

Event.after(nil) #=> returns all events
@radar
Copy link
Owner

radar commented Mar 14, 2019

I agree that both of these should return the default scope. Please submit a patch to that effect.

@johnnyshields
Copy link
Collaborator

Hmmm... it's ok but please make sure .after_now continues to work.

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

No branches or pull requests

3 participants