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

Introduce today_or_future? method #50945

Closed
wants to merge 1 commit into from
Closed

Conversation

olimart
Copy link
Contributor

@olimart olimart commented Feb 2, 2024

Motivation / Background

This Pull Request introduces a convenient helper to check if a date/time is either today or in the future.

Drawing inspiration from #46786 which introduces .local? helper for environment check.

Detail

This Pull Request changes:

  • ActiveSupport::TimeWithZone
  • DateAndTime::Calculations

Additional information

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

@olimart
Copy link
Contributor Author

olimart commented Feb 4, 2024

👋 @rafaelfranca would Rails be interested by such helper?
If so, do we need tests? (given the underlying methods are already tested)

@zzak
Copy link
Member

zzak commented Feb 4, 2024

In my experience, there has to be a really good use-case to add new features to Active Support.

Either by way of solving a really common and user-unfriendly experience in the application, or addressing the needs of the frameworks and ecosystem of Rails.

If that hasn't been found for this feature it will probably be closed.

@rafaelfranca
Copy link
Member

Yeah, multiple versions of those methods were already proposed. So far, we have no reason to believe that they are necessary. Thank you for the pull request

@olimart olimart deleted the today-or-future branch February 10, 2024 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants