1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activesupport/lib
Daniel Colson 3cfb05daa4
Remove unnecessary reduce in Duration#inspect
When the `Duration` class was introduced in 276c9f29, the `parts` were
represented as an array of arrays
(for example `[[:seconds, 5], [:days, 3], [:seconds, 7]]`).
At that time the `reduce` in `#inspect` made sense,
since we would need to get the totals for each part
(the example would become `{ seconds: 12, days: 3 }`).

With the current version of `Duration` we call `to_h` on the `parts`
immediately on initialize, so now the `reduce` doesn't seem to be doing
anything meaningful.
2018-11-24 11:42:28 -05:00
..
active_support Remove unnecessary reduce in Duration#inspect 2018-11-24 11:42:28 -05:00
active_support.rb Bump license years for 2018 2017-12-31 22:36:55 +09:00