Perfect your code
With built-in code review tools, GitHub makes it easy to raise the quality bar before you ship. Join the 40 million developers who've merged over 200 million pull requests.
Sign up for free See pricing for teams and enterprises[ci skip] Update documentation for Range#to_formatted_s #19128
Conversation
This comment has been minimized.
This comment has been minimized.
I don't think we should tell people to replace and break the |
This comment has been minimized.
This comment has been minimized.
@kaspth yes, you're right, thanks! |
This comment has been minimized.
This comment has been minimized.
@kaspth fixed this |
This comment has been minimized.
This comment has been minimized.
I'd love it if we could make the documentation here more consistent with Date's rails/activesupport/lib/active_support/core_ext/date/conversions.rb Lines 28 to 51 in afc98ea |
This comment has been minimized.
This comment has been minimized.
@kaspth fixed this too |
# == Adding your own range formats to to_formatted_s | ||
# You can add your own formats to the Range::RANGE_FORMATS hash. | ||
# Use the format name as the hash key and either a Proc instance | ||
# that takes a start and stop arguments as the value. |
This comment has been minimized.
This comment has been minimized.
# | ||
# == Adding your own range formats to to_formatted_s | ||
# You can add your own formats to the Range::RANGE_FORMATS hash. | ||
# Use the format name as the hash key and either a Proc instance |
This comment has been minimized.
This comment has been minimized.
# that takes a start and stop arguments as the value. | ||
# | ||
# # config/initializers/range_formats.rb | ||
# Range::RANGE_FORMATS[:example] = ->(start, stop) { "you range between '#{start.to_s(:db)}' and '#{stop.to_s(:db)}'" } |
This comment has been minimized.
This comment has been minimized.
kaspth
Feb 28, 2015
Member
Let's use a more real example, like:
Range::RANGE_FORMATS[:short] = ->(start, stop) { "Between #{start.to_s(:short)} and #{stop.to_s(:short)}" }
This comment has been minimized.
This comment has been minimized.
@kaspth fixed all. Thanks for review! |
This comment has been minimized.
This comment has been minimized.
No problem, |
[ci skip] Update documentation for Range#to_formatted_s
This comment has been minimized.
This comment has been minimized.
Holy crap! You got the 50000th commit to Rails |
This comment has been minimized.
This comment has been minimized.
WOW! |
This comment has been minimized.
This comment has been minimized.
|
davydovanton commentedFeb 28, 2015
Added information about default🎉
:db
format and added information about custom formats