diff options
Diffstat (limited to 'activesupport/CHANGELOG.md')
-rw-r--r-- | activesupport/CHANGELOG.md | 57 |
1 files changed, 56 insertions, 1 deletions
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md index 100d57aa16..25e2ee04f9 100644 --- a/activesupport/CHANGELOG.md +++ b/activesupport/CHANGELOG.md @@ -1,3 +1,58 @@ +* Support not to cache `nil` for `ActiveSupport::Cache#fetch`. + + cache.fetch('bar', skip_nil: true) { nil } + cache.exist?('bar') # => false + + *Martin Hong* + +* Add "event object" support to the notification system. + Before this change, end users were forced to create hand made artisanal + event objects on their own, like this: + + ActiveSupport::Notifications.subscribe('wait') do |*args| + @event = ActiveSupport::Notifications::Event.new(*args) + end + + ActiveSupport::Notifications.instrument('wait') do + sleep 1 + end + + @event.duration # => 1000.138 + + After this change, if the block passed to `subscribe` only takes one + parameter, the framework will yield an event object to the block. Now + end users are no longer required to make their own: + + ActiveSupport::Notifications.subscribe('wait') do |event| + @event = event + end + + ActiveSupport::Notifications.instrument('wait') do + sleep 1 + end + + p @event.allocations # => 7 + p @event.cpu_time # => 0.256 + p @event.idle_time # => 1003.2399 + + Now you can enjoy event objects without making them yourself. Neat! + + *Aaron "t.lo" Patterson* + +* Add cpu_time, idle_time, and allocations to Event + + *Eileen M. Uchitelle*, *Aaron Patterson* + +* RedisCacheStore: support key expiry in increment/decrement. + + Pass `:expires_in` to `#increment` and `#decrement` to set a Redis EXPIRE on the key. + + If the key is already set to expire, RedisCacheStore won't extend its expiry. + + Rails.cache.increment("some_key", 1, expires_in: 2.minutes) + + *Jason Lee* + * Allow Range#=== and Range#cover? on Range `Range#cover?` can now accept a range argument like `Range#include?` and @@ -41,7 +96,7 @@ *Godfrey Chan* -* Fix bug where `URI.unscape` would fail with mixed Unicode/escaped character input: +* Fix bug where `URI.unescape` would fail with mixed Unicode/escaped character input: URI.unescape("\xe3\x83\x90") # => "バ" URI.unescape("%E3%83%90") # => "バ" |