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

[DOC] Method #end_of_week is missing in active_support/core_ext/date/calculations.rb #32543

Closed
belgoros opened this issue Apr 12, 2018 · 2 comments

Comments

@belgoros
Copy link

belgoros commented Apr 12, 2018

The last Rails Guides say:

All the following methods are defined in active_support/core_ext/date/calculations.rb.

yesterday
tomorrow
beginning_of_week (at_beginning_of_week)
end_of_week (at_end_of_week)
monday
sunday
weeks_ago
prev_week (last_week)
next_week
months_ago
months_since
beginning_of_month (at_beginning_of_month)
end_of_month (at_end_of_month)
last_month
beginning_of_quarter (at_beginning_of_quarter)
end_of_quarter (at_end_of_quarter)
beginning_of_year (at_beginning_of_year)
end_of_year (at_end_of_year)
years_ago
years_since
last_year
on_weekday?

But when checking calculations.rb file, end_of_weekmethod does not seem to exist. I didn't check the other ones.

It is in active_support/core_ext/date_and_time/calculations.rb if I'm not wrong.

@belgoros belgoros changed the title [DOC] Method end_of_week is missing in active_support/core_ext/date/calculations.rb [DOC] Method #end_of_week is missing in active_support/core_ext/date/calculations.rb Apr 12, 2018
@matthewd
Copy link
Member

It is in active_support/core_ext/date_and_time/calculations.rb if I'm not wrong.

Right; a number of methods have been moved there to share across the Date & Time classes.

Want to open a PR to update the guide?

@belgoros
Copy link
Author

@matthewd with pleasure, sooner or later, - I'll have to start 😄

bogdanvlviv added a commit to bogdanvlviv/rails that referenced this issue Jun 12, 2018
Remove general sentence that explains that all methods that Active Support
brings to `Date` `Time`, `DateTime` are defined in
`active_support/core_ext/date/calculations.rb` since it isn't true.
Add a references to an appropriate file where methods are defined
like it is done with the other methods in this guide.

Context rails#32552 (comment)

Related to rails#32543, rails#32552

[ci skip]
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

2 participants