2021-04-12 06:37:45 -04:00
|
|
|
|
* Fix issue in `Hash#deep_merge` where it did not properly duplicate a nested `Hash`
|
|
|
|
|
|
|
|
|
|
*Marcel Eeken*
|
|
|
|
|
|
2021-04-03 12:30:32 -04:00
|
|
|
|
* Add `expires_at` argument to `ActiveSupport::Cache` `write` and `fetch` to set a cache entry TTL as an absolute time.
|
|
|
|
|
|
|
|
|
|
```ruby
|
|
|
|
|
Rails.cache.write(key, value, expires_at: Time.now.at_end_of_hour)
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
*Jean Boussier*
|
|
|
|
|
|
2021-04-04 11:57:51 -04:00
|
|
|
|
* Deprecate `ActiveSupport::TimeWithZone.name` so that from Rails 7.1 it will use the default implementation.
|
|
|
|
|
|
|
|
|
|
*Andrew White*
|
|
|
|
|
|
Disable parallel testing when running individual files
Setting up the parallel workers could be an overhead when running
individual files.
This patch disables that process in case the number of files to run
is less than one.
Results running a sample file:
Before:
```
actionpack $ bin/test test/controller/parameters/accessors_test.rb
Run options: --seed 48261
........................................................................
Finished in 0.211923s, 339.7460 runs/s, 552.0873 assertions/s.
72 runs, 117 assertions, 0 failures, 0 errors, 0 skips
```
After
```
actionpack $ bin/test test/controller/parameters/accessors_test.rb
Run options: --seed 5461
........................................................................
Finished in 0.008411s, 8560.2189 runs/s, 13910.3557 assertions/s.
72 runs, 117 assertions, 0 failures, 0 errors, 0 skips
```
2021-02-24 17:42:34 -05:00
|
|
|
|
* Tests parallelization is now disabled when running individual files to prevent the setup overhead.
|
|
|
|
|
|
|
|
|
|
It can still be enforced if the environment variable `PARALLEL_WORKERS` is present and set to a value greater than 1.
|
|
|
|
|
|
|
|
|
|
*Ricardo Díaz*
|
|
|
|
|
|
2021-02-22 11:42:48 -05:00
|
|
|
|
* Fix proxying keyword arguments in `ActiveSupport::CurrentAttributes`.
|
|
|
|
|
|
|
|
|
|
*Marcin Kołodziej*
|
|
|
|
|
|
2021-02-11 05:15:10 -05:00
|
|
|
|
* Add `Enumerable#maximum` and `Enumerable#minimum` to easily calculate the maximum or minimum from extracted
|
|
|
|
|
elements of an enumerable.
|
|
|
|
|
|
|
|
|
|
```ruby
|
|
|
|
|
payments = [Payment.new(5), Payment.new(15), Payment.new(10)]
|
|
|
|
|
|
|
|
|
|
payments.minimum(:price) # => 5
|
2021-03-10 00:27:53 -05:00
|
|
|
|
payments.maximum(:price) # => 15
|
2021-02-11 05:15:10 -05:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
This also allows passing enumerables to `fresh_when` and `stale?` in Action Controller.
|
|
|
|
|
See PR [#41404](https://github.com/rails/rails/pull/41404) for an example.
|
|
|
|
|
|
|
|
|
|
*Ayrton De Craene*
|
|
|
|
|
|
2021-02-09 09:16:38 -05:00
|
|
|
|
* `ActiveSupport::Cache::MemCacheStore` now accepts an explicit `nil` for its `addresses` argument.
|
|
|
|
|
|
|
|
|
|
```ruby
|
|
|
|
|
config.cache_store = :mem_cache_store, nil
|
|
|
|
|
|
|
|
|
|
# is now equivalent to
|
|
|
|
|
|
|
|
|
|
config.cache_store = :mem_cache_store
|
|
|
|
|
|
|
|
|
|
# and is also equivalent to
|
|
|
|
|
|
|
|
|
|
config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211"
|
|
|
|
|
|
|
|
|
|
# which is the fallback behavior of Dalli
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
This helps those migrating from `:dalli_store`, where an explicit `nil` was permitted.
|
|
|
|
|
|
|
|
|
|
*Michael Overmeyer*
|
|
|
|
|
|
2021-02-05 11:28:50 -05:00
|
|
|
|
* Add `Enumerable#in_order_of` to put an Enumerable in a certain order by a key.
|
|
|
|
|
|
|
|
|
|
*DHH*
|
|
|
|
|
|
2021-02-02 13:20:39 -05:00
|
|
|
|
* `ActiveSupport::Inflector.camelize` behaves expected when provided a symbol `:upper` or `:lower` argument. Matches
|
|
|
|
|
`String#camelize` behavior.
|
|
|
|
|
|
|
|
|
|
*Alex Ghiculescu*
|
|
|
|
|
|
2020-12-28 19:30:40 -05:00
|
|
|
|
* Raises an `ArgumentError` when the first argument of `ActiveSupport::Notification.subscribe` is
|
|
|
|
|
invalid.
|
|
|
|
|
|
|
|
|
|
*Vipul A M*
|
|
|
|
|
|
2020-11-27 16:46:58 -05:00
|
|
|
|
* `HashWithIndifferentAccess#deep_transform_keys` now returns a `HashWithIndifferentAccess` instead of a `Hash`.
|
|
|
|
|
|
|
|
|
|
*Nathaniel Woodthorpe*
|
|
|
|
|
|
2020-12-18 02:40:33 -05:00
|
|
|
|
* consume dalli’s `cache_nils` configuration as `ActiveSupport::Cache`'s `skip_nil` when using `MemCacheStore`.
|
|
|
|
|
|
|
|
|
|
*Ritikesh G*
|
|
|
|
|
|
2020-12-29 02:52:24 -05:00
|
|
|
|
* add `RedisCacheStore#stats` method similar to `MemCacheStore#stats`. Calls `redis#info` internally.
|
|
|
|
|
|
|
|
|
|
*Ritikesh G*
|
|
|
|
|
|
2020-07-25 22:19:34 -04:00
|
|
|
|
|
2020-12-02 18:37:26 -05:00
|
|
|
|
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/activesupport/CHANGELOG.md) for previous changes.
|