diff options
Diffstat (limited to 'activesupport/CHANGELOG.md')
-rw-r--r-- | activesupport/CHANGELOG.md | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md index d1b3147cef..cc27b6a0fc 100644 --- a/activesupport/CHANGELOG.md +++ b/activesupport/CHANGELOG.md @@ -1,3 +1,25 @@ +* Change `ActiveSupport::Duration` creation with numeric methods like `1.week` + to create durations with more predictable and ISO8601-conformant parts. + + This is to remove astonishment from getting `3600 seconds` from `1.hour`. + + It should not affect current apps as duration's `value` (number of seconds) remains the same, + only hash of `parts` (and `inspect` value) is changed and only when it's constructed by calling + methods on integers. Manual construction of Durations isn't affected. + Inside the ActiveSupport::Duration itself most operations rely only on number of seconds. + + Before: + + [1.hour.inspect, 1.hour.value, 1.hour.parts] # => ["3600 seconds", 3600, [[:seconds, 3600]]] + [1.week.inspect, 1.week.value, 1.week.parts] # => ["7 days", 604800, [[:days, 7]]] + + After: + + [1.hour.inspect, 1.hour.value, 1.hour.parts] # => ["1 hour", 3600, [[:hours, 1]]] + [1.week.inspect, 1.week.value, 1.week.parts] # => ["1 week", 604800, [[:weeks, 1]]] + + *Andrey Novikov* + ## Rails 5.0.0.beta4 (April 27, 2016) ## * Time zones: Ensure that the UTC offset reflects DST changes that occurred |