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 ActionView::Helpers::DateHelper#distance_of_time_in_words test #27091

Closed
wants to merge 2 commits into from

Commits on Nov 25, 2016

  1. Add Integer#round and Float#round core extensions

    `half` option was added to Integer#round and Float#round in Ruby 2.4.
    And a behavior of round was changed to round to even.
    We have depended a behavior of rounding to nearest.
    In some case (i.e. `ActionView::Helpers::DateHelper#distance_of_time_in_words`),
    we have to pass `half: :up` to `round`.
    
    This core_ext enables to us to pass a option,
    even before Ruby 2.3.
    yui-knk committed Nov 25, 2016
    Copy the full SHA
    61a6597 View commit details
    Browse the repository at this point in the history
  2. Ensure to round to nearest

    The behavior of `#round` was changed to round to even in Ruby 2.4.
    So we have to pass `half: :up` to `#round`.
    
    see: ruby/ruby@dfe91fc
    yui-knk committed Nov 25, 2016
    Copy the full SHA
    09c3d28 View commit details
    Browse the repository at this point in the history