aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/CHANGELOG.md
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/CHANGELOG.md')
-rw-r--r--activesupport/CHANGELOG.md98
1 files changed, 78 insertions, 20 deletions
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md
index f8423c3ef8..3e07f5a032 100644
--- a/activesupport/CHANGELOG.md
+++ b/activesupport/CHANGELOG.md
@@ -1,3 +1,81 @@
+* `ActiveSupport::Duration` supports weeks and hours.
+
+ [1.hour.inspect, 1.hour.value, 1.hour.parts]
+ # => ["3600 seconds", 3600, [[:seconds, 3600]]] # Before
+ # => ["1 hour", 3600, [[:hours, 1]]] # After
+
+ [1.week.inspect, 1.week.value, 1.week.parts]
+ # => ["7 days", 604800, [[:days, 7]]] # Before
+ # => ["1 week", 604800, [[:weeks, 1]]] # After
+
+ This brings us into closer conformance with ISO8601 and relieves some
+ astonishment about getting `1.hour.inspect # => 3600 seconds`.
+
+ Compatibility: The duration's `value` remains the same, so apps using
+ durations are oblivious to the new time periods. Apps, libraries, and
+ plugins that work with the internal `parts` hash will need to broaden
+ their time period handling to cover hours & weeks.
+
+ *Andrey Novikov*
+
+## Rails 5.0.0.beta4 (April 27, 2016) ##
+
+* Time zones: Ensure that the UTC offset reflects DST changes that occurred
+ since the app started. Removes UTC offset caching, reducing performance,
+ but this is still relatively quick and isn't in any hot paths.
+
+ *Alexey Shein*
+
+* Make `getlocal` and `getutc` always return instances of `Time` for
+ `ActiveSupport::TimeWithZone` and `DateTime`. This eliminates a possible
+ stack level too deep error in `to_time` where `ActiveSupport::TimeWithZone`
+ was wrapping a `DateTime` instance. As a consequence of this the internal
+ time value in `ActiveSupport::TimeWithZone` is now always an instance of
+ `Time` in the UTC timezone, whether that's as the UTC time directly or
+ a representation of the local time in the timezone. There should be no
+ consequences of this internal change and if there are it's a bug due to
+ leaky abstractions.
+
+ *Andrew White*
+
+* Add `DateTime#subsec` to return the fraction of a second as a `Rational`.
+
+ *Andrew White*
+
+* Add additional aliases for `DateTime#utc` to mirror the ones on
+ `ActiveSupport::TimeWithZone` and `Time`.
+
+ *Andrew White*
+
+* Add `DateTime#localtime` to return an instance of `Time` in the system's
+ local timezone. Also aliased to `getlocal`.
+
+ *Andrew White*, *Yuichiro Kaneko*
+
+* Add `Time#sec_fraction` to return the fraction of a second as a `Rational`.
+
+ *Andrew White*
+
+* Add `ActiveSupport.to_time_preserves_timezone` config option to control
+ how `to_time` handles timezones. In Ruby 2.4+ the behavior will change
+ from converting to the local system timezone, to preserving the timezone
+ of the receiver. This config option defaults to false so that apps made
+ with earlier versions of Rails are not affected when upgrading, e.g:
+
+ >> ENV['TZ'] = 'US/Eastern'
+
+ >> "2016-04-23T10:23:12.000Z".to_time
+ => "2016-04-23T06:23:12.000-04:00"
+
+ >> ActiveSupport.to_time_preserves_timezone = true
+
+ >> "2016-04-23T10:23:12.000Z".to_time
+ => "2016-04-23T10:23:12.000Z"
+
+ Fixes #24617.
+
+ *Andrew White*
+
* `ActiveSupport::TimeZone.country_zones(country_code)` looks up the
country's time zones by its two-letter ISO3166 country code, e.g.
@@ -56,26 +134,6 @@
*Santosh Wadghule*
-* `ActiveSupport::Duration` supports weeks and hours.
-
- [1.hour.inspect, 1.hour.value, 1.hour.parts]
- # => ["3600 seconds", 3600, [[:seconds, 3600]]] # Before
- # => ["1 hour", 3600, [[:hours, 1]]] # After
-
- [1.week.inspect, 1.week.value, 1.week.parts]
- # => ["7 days", 604800, [[:days, 7]]] # Before
- # => ["1 week", 604800, [[:weeks, 1]]] # After
-
- This brings us into closer conformance with ISO8601 and relieves some
- astonishment about getting `1.hour.inspect # => 3600 seconds`.
-
- Compatibility: The duration's `value` remains the same, so apps using
- durations are oblivious to the new time periods. Apps, libraries, and
- plugins that work with the internal `parts` hash will need to broaden
- their time period handling to cover hours & weeks.
-
- *Andrey Novikov*
-
* Fix behavior of JSON encoding for `Exception`.
*namusyaka*