activesupport 6.1.6.1 → 7.0.3.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activesupport might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +231 -515
- data/lib/active_support/actionable_error.rb +1 -1
- data/lib/active_support/array_inquirer.rb +0 -2
- data/lib/active_support/backtrace_cleaner.rb +2 -2
- data/lib/active_support/benchmarkable.rb +2 -2
- data/lib/active_support/cache/file_store.rb +15 -9
- data/lib/active_support/cache/mem_cache_store.rb +132 -37
- data/lib/active_support/cache/memory_store.rb +24 -16
- data/lib/active_support/cache/null_store.rb +10 -2
- data/lib/active_support/cache/redis_cache_store.rb +47 -72
- data/lib/active_support/cache/strategy/local_cache.rb +38 -61
- data/lib/active_support/cache.rb +193 -46
- data/lib/active_support/callbacks.rb +184 -85
- data/lib/active_support/code_generator.rb +65 -0
- data/lib/active_support/concern.rb +5 -5
- data/lib/active_support/concurrency/load_interlock_aware_monitor.rb +2 -4
- data/lib/active_support/concurrency/share_lock.rb +2 -2
- data/lib/active_support/configurable.rb +8 -5
- data/lib/active_support/configuration_file.rb +1 -1
- data/lib/active_support/core_ext/array/access.rb +1 -5
- data/lib/active_support/core_ext/array/conversions.rb +13 -12
- data/lib/active_support/core_ext/array/deprecated_conversions.rb +25 -0
- data/lib/active_support/core_ext/array/grouping.rb +6 -6
- data/lib/active_support/core_ext/array/inquiry.rb +2 -2
- data/lib/active_support/core_ext/array.rb +1 -0
- data/lib/active_support/core_ext/big_decimal/conversions.rb +1 -1
- data/lib/active_support/core_ext/class/subclasses.rb +25 -17
- data/lib/active_support/core_ext/date/blank.rb +1 -1
- data/lib/active_support/core_ext/date/calculations.rb +9 -9
- data/lib/active_support/core_ext/date/conversions.rb +14 -14
- data/lib/active_support/core_ext/date/deprecated_conversions.rb +26 -0
- data/lib/active_support/core_ext/date.rb +1 -0
- data/lib/active_support/core_ext/date_and_time/calculations.rb +4 -4
- data/lib/active_support/core_ext/date_and_time/compatibility.rb +1 -1
- data/lib/active_support/core_ext/date_time/blank.rb +1 -1
- data/lib/active_support/core_ext/date_time/conversions.rb +13 -13
- data/lib/active_support/core_ext/date_time/deprecated_conversions.rb +22 -0
- data/lib/active_support/core_ext/date_time.rb +1 -0
- data/lib/active_support/core_ext/digest/uuid.rb +39 -14
- data/lib/active_support/core_ext/enumerable.rb +101 -32
- data/lib/active_support/core_ext/file/atomic.rb +3 -1
- data/lib/active_support/core_ext/hash/conversions.rb +0 -1
- data/lib/active_support/core_ext/hash/indifferent_access.rb +3 -3
- data/lib/active_support/core_ext/hash/keys.rb +1 -1
- data/lib/active_support/core_ext/kernel/reporting.rb +4 -4
- data/lib/active_support/core_ext/kernel/singleton_class.rb +1 -1
- data/lib/active_support/core_ext/module/attribute_accessors.rb +2 -0
- data/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb +19 -10
- data/lib/active_support/core_ext/module/delegation.rb +2 -8
- data/lib/active_support/core_ext/name_error.rb +2 -8
- data/lib/active_support/core_ext/numeric/conversions.rb +80 -77
- data/lib/active_support/core_ext/numeric/deprecated_conversions.rb +60 -0
- data/lib/active_support/core_ext/numeric.rb +1 -0
- data/lib/active_support/core_ext/object/acts_like.rb +29 -5
- data/lib/active_support/core_ext/object/blank.rb +2 -2
- data/lib/active_support/core_ext/object/deep_dup.rb +1 -1
- data/lib/active_support/core_ext/object/duplicable.rb +11 -0
- data/lib/active_support/core_ext/object/json.rb +30 -25
- data/lib/active_support/core_ext/object/to_query.rb +2 -2
- data/lib/active_support/core_ext/object/try.rb +20 -20
- data/lib/active_support/core_ext/object/with_options.rb +20 -1
- data/lib/active_support/core_ext/pathname/existence.rb +21 -0
- data/lib/active_support/core_ext/pathname.rb +3 -0
- data/lib/active_support/core_ext/range/compare_range.rb +0 -25
- data/lib/active_support/core_ext/range/conversions.rb +8 -8
- data/lib/active_support/core_ext/range/deprecated_conversions.rb +26 -0
- data/lib/active_support/core_ext/range/each.rb +1 -1
- data/lib/active_support/core_ext/range/include_time_with_zone.rb +4 -25
- data/lib/active_support/core_ext/range/overlaps.rb +1 -1
- data/lib/active_support/core_ext/range.rb +1 -1
- data/lib/active_support/core_ext/securerandom.rb +1 -1
- data/lib/active_support/core_ext/string/conversions.rb +2 -2
- data/lib/active_support/core_ext/string/filters.rb +1 -1
- data/lib/active_support/core_ext/string/inflections.rb +1 -1
- data/lib/active_support/core_ext/string/inquiry.rb +1 -1
- data/lib/active_support/core_ext/string/output_safety.rb +62 -38
- data/lib/active_support/core_ext/symbol/starts_ends_with.rb +0 -8
- data/lib/active_support/core_ext/time/calculations.rb +7 -8
- data/lib/active_support/core_ext/time/conversions.rb +13 -12
- data/lib/active_support/core_ext/time/deprecated_conversions.rb +22 -0
- data/lib/active_support/core_ext/time/zones.rb +7 -22
- data/lib/active_support/core_ext/time.rb +1 -0
- data/lib/active_support/core_ext/uri.rb +3 -27
- data/lib/active_support/core_ext.rb +1 -0
- data/lib/active_support/current_attributes.rb +31 -14
- data/lib/active_support/dependencies/interlock.rb +10 -18
- data/lib/active_support/dependencies/require_dependency.rb +28 -0
- data/lib/active_support/dependencies.rb +58 -788
- data/lib/active_support/deprecation/behaviors.rb +5 -2
- data/lib/active_support/deprecation/method_wrappers.rb +3 -3
- data/lib/active_support/deprecation/proxy_wrappers.rb +2 -2
- data/lib/active_support/deprecation.rb +2 -2
- data/lib/active_support/descendants_tracker.rb +174 -68
- data/lib/active_support/digest.rb +4 -4
- data/lib/active_support/duration/iso8601_parser.rb +3 -3
- data/lib/active_support/duration/iso8601_serializer.rb +9 -1
- data/lib/active_support/duration.rb +77 -48
- data/lib/active_support/encrypted_configuration.rb +13 -2
- data/lib/active_support/encrypted_file.rb +1 -1
- data/lib/active_support/environment_inquirer.rb +1 -1
- data/lib/active_support/error_reporter.rb +117 -0
- data/lib/active_support/evented_file_update_checker.rb +3 -5
- data/lib/active_support/execution_context/test_helper.rb +13 -0
- data/lib/active_support/execution_context.rb +53 -0
- data/lib/active_support/execution_wrapper.rb +30 -11
- data/lib/active_support/executor/test_helper.rb +7 -0
- data/lib/active_support/fork_tracker.rb +19 -12
- data/lib/active_support/gem_version.rb +4 -4
- data/lib/active_support/hash_with_indifferent_access.rb +3 -1
- data/lib/active_support/html_safe_translation.rb +43 -0
- data/lib/active_support/i18n.rb +1 -0
- data/lib/active_support/i18n_railtie.rb +1 -1
- data/lib/active_support/inflector/inflections.rb +23 -7
- data/lib/active_support/inflector/methods.rb +24 -48
- data/lib/active_support/inflector/transliterate.rb +1 -1
- data/lib/active_support/isolated_execution_state.rb +72 -0
- data/lib/active_support/json/encoding.rb +3 -3
- data/lib/active_support/key_generator.rb +22 -5
- data/lib/active_support/lazy_load_hooks.rb +14 -3
- data/lib/active_support/locale/en.yml +1 -1
- data/lib/active_support/log_subscriber/test_helper.rb +2 -2
- data/lib/active_support/log_subscriber.rb +15 -5
- data/lib/active_support/logger.rb +4 -5
- data/lib/active_support/logger_thread_safe_level.rb +4 -13
- data/lib/active_support/message_encryptor.rb +12 -6
- data/lib/active_support/message_verifier.rb +46 -14
- data/lib/active_support/messages/metadata.rb +2 -2
- data/lib/active_support/multibyte/chars.rb +10 -11
- data/lib/active_support/multibyte/unicode.rb +0 -12
- data/lib/active_support/multibyte.rb +1 -1
- data/lib/active_support/notifications/fanout.rb +91 -65
- data/lib/active_support/notifications/instrumenter.rb +32 -15
- data/lib/active_support/notifications.rb +17 -23
- data/lib/active_support/number_helper/number_converter.rb +1 -3
- data/lib/active_support/number_helper/number_to_currency_converter.rb +11 -6
- data/lib/active_support/number_helper/number_to_delimited_converter.rb +1 -1
- data/lib/active_support/number_helper/number_to_human_size_converter.rb +1 -1
- data/lib/active_support/number_helper/number_to_phone_converter.rb +1 -1
- data/lib/active_support/number_helper/rounding_helper.rb +1 -5
- data/lib/active_support/number_helper.rb +0 -2
- data/lib/active_support/option_merger.rb +8 -16
- data/lib/active_support/ordered_hash.rb +1 -1
- data/lib/active_support/ordered_options.rb +1 -1
- data/lib/active_support/parameter_filter.rb +5 -0
- data/lib/active_support/per_thread_registry.rb +5 -1
- data/lib/active_support/railtie.rb +69 -19
- data/lib/active_support/rescuable.rb +4 -4
- data/lib/active_support/ruby_features.rb +7 -0
- data/lib/active_support/secure_compare_rotator.rb +2 -2
- data/lib/active_support/string_inquirer.rb +0 -2
- data/lib/active_support/subscriber.rb +7 -18
- data/lib/active_support/tagged_logging.rb +16 -1
- data/lib/active_support/test_case.rb +9 -21
- data/lib/active_support/testing/assertions.rb +35 -5
- data/lib/active_support/testing/deprecation.rb +52 -1
- data/lib/active_support/testing/isolation.rb +2 -2
- data/lib/active_support/testing/method_call_assertions.rb +5 -5
- data/lib/active_support/testing/parallelization/server.rb +4 -0
- data/lib/active_support/testing/parallelization/worker.rb +3 -0
- data/lib/active_support/testing/parallelization.rb +4 -0
- data/lib/active_support/testing/parallelize_executor.rb +76 -0
- data/lib/active_support/testing/stream.rb +3 -5
- data/lib/active_support/testing/tagged_logging.rb +1 -1
- data/lib/active_support/testing/time_helpers.rb +13 -2
- data/lib/active_support/time_with_zone.rb +58 -17
- data/lib/active_support/values/time_zone.rb +33 -14
- data/lib/active_support/version.rb +1 -1
- data/lib/active_support/xml_mini/jdom.rb +1 -1
- data/lib/active_support/xml_mini/libxml.rb +5 -5
- data/lib/active_support/xml_mini/libxmlsax.rb +1 -1
- data/lib/active_support/xml_mini/nokogiri.rb +4 -4
- data/lib/active_support/xml_mini/nokogirisax.rb +1 -1
- data/lib/active_support/xml_mini/rexml.rb +1 -1
- data/lib/active_support/xml_mini.rb +5 -4
- data/lib/active_support.rb +16 -0
- metadata +23 -21
- data/lib/active_support/core_ext/marshal.rb +0 -26
- data/lib/active_support/dependencies/zeitwerk_integration.rb +0 -120
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,14 @@
|
|
1
|
-
## Rails
|
1
|
+
## Rails 7.0.3.1 (July 12, 2022) ##
|
2
2
|
|
3
3
|
* No changes.
|
4
4
|
|
5
5
|
|
6
|
-
## Rails
|
6
|
+
## Rails 7.0.3 (May 09, 2022) ##
|
7
|
+
|
8
|
+
* No changes.
|
9
|
+
|
10
|
+
|
11
|
+
## Rails 7.0.2.4 (April 26, 2022) ##
|
7
12
|
|
8
13
|
* Fix and add protections for XSS in `ActionView::Helpers` and `ERB::Util`.
|
9
14
|
|
@@ -12,711 +17,422 @@
|
|
12
17
|
|
13
18
|
*Álvaro Martín Fraguas*
|
14
19
|
|
15
|
-
## Rails
|
16
|
-
|
17
|
-
* Fix `ActiveSupport::Duration.build` to support negative values.
|
18
|
-
|
19
|
-
The algorithm to collect the `parts` of the `ActiveSupport::Duration`
|
20
|
-
ignored the sign of the `value` and accumulated incorrect part values. This
|
21
|
-
impacted `ActiveSupport::Duration#sum` (which is dependent on `parts`) but
|
22
|
-
not `ActiveSupport::Duration#eql?` (which is dependent on `value`).
|
23
|
-
|
24
|
-
*Caleb Buxton*, *Braden Staudacher*
|
25
|
-
|
26
|
-
* `Time#change` and methods that call it (eg. `Time#advance`) will now
|
27
|
-
return a `Time` with the timezone argument provided, if the caller was
|
28
|
-
initialized with a timezone argument.
|
29
|
-
|
30
|
-
Fixes [#42467](https://github.com/rails/rails/issues/42467).
|
31
|
-
|
32
|
-
*Alex Ghiculescu*
|
33
|
-
|
34
|
-
* Clone to keep extended Logger methods for tagged logger.
|
35
|
-
|
36
|
-
*Orhan Toy*
|
37
|
-
|
38
|
-
* `assert_changes` works on including `ActiveSupport::Assertions` module.
|
39
|
-
|
40
|
-
*Pedro Medeiros*
|
41
|
-
|
42
|
-
|
43
|
-
## Rails 6.1.4.7 (March 08, 2022) ##
|
20
|
+
## Rails 7.0.2.3 (March 08, 2022) ##
|
44
21
|
|
45
22
|
* No changes.
|
46
23
|
|
47
24
|
|
48
|
-
## Rails
|
25
|
+
## Rails 7.0.2.2 (February 11, 2022) ##
|
49
26
|
|
50
27
|
* Fix Reloader method signature to work with the new Executor signature
|
51
28
|
|
52
29
|
|
53
|
-
## Rails
|
54
|
-
|
55
|
-
* No changes.
|
56
|
-
|
57
|
-
|
58
|
-
## Rails 6.1.4.4 (December 15, 2021) ##
|
59
|
-
|
60
|
-
* No changes.
|
61
|
-
|
62
|
-
|
63
|
-
## Rails 6.1.4.3 (December 14, 2021) ##
|
30
|
+
## Rails 7.0.2.1 (February 11, 2022) ##
|
64
31
|
|
65
32
|
* No changes.
|
66
33
|
|
67
34
|
|
68
|
-
## Rails
|
69
|
-
|
70
|
-
* No changes.
|
35
|
+
## Rails 7.0.2 (February 08, 2022) ##
|
71
36
|
|
37
|
+
* Fix `ActiveSupport::EncryptedConfiguration` to be compatible with Psych 4
|
72
38
|
|
73
|
-
|
74
|
-
|
75
|
-
* No changes.
|
39
|
+
*Stephen Sugden*
|
76
40
|
|
41
|
+
* Improve `File.atomic_write` error handling.
|
77
42
|
|
78
|
-
|
43
|
+
*Daniel Pepper*
|
79
44
|
|
80
|
-
* MemCacheStore: convert any underlying value (including `false`) to an `Entry`.
|
81
|
-
|
82
|
-
See [#42559](https://github.com/rails/rails/pull/42559).
|
83
|
-
|
84
|
-
*Alex Ghiculescu*
|
85
45
|
|
86
|
-
|
46
|
+
## Rails 7.0.1 (January 06, 2022) ##
|
87
47
|
|
88
|
-
|
48
|
+
* Fix `Class#descendants` and `DescendantsTracker#descendants` compatibility with Ruby 3.1.
|
89
49
|
|
90
|
-
|
91
|
-
|
92
|
-
* Check byte size instead of length on `secure_compare`.
|
93
|
-
|
94
|
-
*Tietew*
|
95
|
-
|
96
|
-
* Fix `Time.at` to not lose `:in` option.
|
97
|
-
|
98
|
-
*Ryuta Kamizono*
|
99
|
-
|
100
|
-
* Require a path for `config.cache_store = :file_store`.
|
101
|
-
|
102
|
-
*Alex Ghiculescu*
|
103
|
-
|
104
|
-
* Avoid having to store complex object in the default translation file.
|
105
|
-
|
106
|
-
*Rafael Mendonça França*
|
50
|
+
[The native `Class#descendants` was reverted prior to Ruby 3.1 release](https://bugs.ruby-lang.org/issues/14394#note-33),
|
51
|
+
but `Class#subclasses` was kept, breaking the feature detection.
|
107
52
|
|
53
|
+
*Jean Boussier*
|
108
54
|
|
109
|
-
## Rails 6.1.3.2 (May 05, 2021) ##
|
110
55
|
|
111
|
-
|
56
|
+
## Rails 7.0.0 (December 15, 2021) ##
|
112
57
|
|
58
|
+
* Fix `ActiveSupport::Duration.build` to support negative values.
|
113
59
|
|
114
|
-
|
60
|
+
The algorithm to collect the `parts` of the `ActiveSupport::Duration`
|
61
|
+
ignored the sign of the `value` and accumulated incorrect part values. This
|
62
|
+
impacted `ActiveSupport::Duration#sum` (which is dependent on `parts`) but
|
63
|
+
not `ActiveSupport::Duration#eql?` (which is dependent on `value`).
|
115
64
|
|
116
|
-
*
|
65
|
+
*Caleb Buxton*, *Braden Staudacher*
|
117
66
|
|
118
67
|
|
119
|
-
## Rails
|
68
|
+
## Rails 7.0.0.rc3 (December 14, 2021) ##
|
120
69
|
|
121
70
|
* No changes.
|
122
71
|
|
123
72
|
|
124
|
-
## Rails
|
73
|
+
## Rails 7.0.0.rc2 (December 14, 2021) ##
|
125
74
|
|
126
75
|
* No changes.
|
127
76
|
|
77
|
+
## Rails 7.0.0.rc1 (December 06, 2021) ##
|
128
78
|
|
129
|
-
|
130
|
-
|
131
|
-
* `ActiveSupport::Cache::MemCacheStore` now accepts an explicit `nil` for its `addresses` argument.
|
132
|
-
|
133
|
-
```ruby
|
134
|
-
config.cache_store = :mem_cache_store, nil
|
135
|
-
|
136
|
-
# is now equivalent to
|
137
|
-
|
138
|
-
config.cache_store = :mem_cache_store
|
139
|
-
|
140
|
-
# and is also equivalent to
|
141
|
-
|
142
|
-
config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211"
|
143
|
-
|
144
|
-
# which is the fallback behavior of Dalli
|
145
|
-
```
|
146
|
-
|
147
|
-
This helps those migrating from `:dalli_store`, where an explicit `nil` was permitted.
|
148
|
-
|
149
|
-
*Michael Overmeyer*
|
150
|
-
|
151
|
-
|
152
|
-
## Rails 6.1.1 (January 07, 2021) ##
|
79
|
+
* Deprecate passing a format to `#to_s` in favor of `#to_formatted_s` in `Array`, `Range`, `Date`, `DateTime`, `Time`,
|
80
|
+
`BigDecimal`, `Float` and, `Integer`.
|
153
81
|
|
154
|
-
*
|
155
|
-
instead of the instance variables of the object.
|
82
|
+
*Rafael Mendonça França*
|
156
83
|
|
157
|
-
|
84
|
+
* Document `ActiveSupport::Testing::Deprecation`.
|
158
85
|
|
159
|
-
|
160
|
-
IPAddr.new("127.0.0.1").to_json
|
161
|
-
# => "{\"addr\":2130706433,\"family\":2,\"mask_addr\":4294967295}"
|
162
|
-
```
|
86
|
+
*Sam Bostock & Sam Jordan*
|
163
87
|
|
164
|
-
|
88
|
+
* Add `Pathname#existence`.
|
165
89
|
|
166
90
|
```ruby
|
167
|
-
|
168
|
-
# => "\"127.0.0.1\""
|
91
|
+
Pathname.new("file").existence&.read
|
169
92
|
```
|
170
93
|
|
94
|
+
*Timo Schilling*
|
171
95
|
|
172
|
-
|
173
|
-
|
174
|
-
* Ensure `MemoryStore` disables compression by default. Reverts behavior of
|
175
|
-
`MemoryStore` to its prior rails `5.1` behavior.
|
176
|
-
|
177
|
-
*Max Gurewitz*
|
178
|
-
|
179
|
-
* Calling `iso8601` on negative durations retains the negative sign on individual
|
180
|
-
digits instead of prepending it.
|
181
|
-
|
182
|
-
This change is required so we can interoperate with PostgreSQL, which prefers
|
183
|
-
negative signs for each component.
|
184
|
-
|
185
|
-
Compatibility with other iso8601 parsers which support leading negatives as well
|
186
|
-
as negatives per component is still retained.
|
187
|
-
|
188
|
-
Before:
|
189
|
-
|
190
|
-
(-1.year - 1.day).iso8601
|
191
|
-
# => "-P1Y1D"
|
192
|
-
|
193
|
-
After:
|
194
|
-
|
195
|
-
(-1.year - 1.day).iso8601
|
196
|
-
# => "P-1Y-1D"
|
197
|
-
|
198
|
-
*Vipul A M*
|
199
|
-
|
200
|
-
* Remove deprecated `ActiveSupport::Notifications::Instrumenter#end=`.
|
201
|
-
|
202
|
-
*Rafael Mendonça França*
|
203
|
-
|
204
|
-
* Deprecate `ActiveSupport::Multibyte::Unicode.default_normalization_form`.
|
205
|
-
|
206
|
-
*Rafael Mendonça França*
|
207
|
-
|
208
|
-
* Remove deprecated `ActiveSupport::Multibyte::Unicode.pack_graphemes`,
|
209
|
-
`ActiveSupport::Multibyte::Unicode.unpack_graphemes`,
|
210
|
-
`ActiveSupport::Multibyte::Unicode.normalize`,
|
211
|
-
`ActiveSupport::Multibyte::Unicode.downcase`,
|
212
|
-
`ActiveSupport::Multibyte::Unicode.upcase` and `ActiveSupport::Multibyte::Unicode.swapcase`.
|
213
|
-
|
214
|
-
*Rafael Mendonça França*
|
215
|
-
|
216
|
-
* Remove deprecated `ActiveSupport::Multibyte::Chars#consumes?` and `ActiveSupport::Multibyte::Chars#normalize`.
|
217
|
-
|
218
|
-
*Rafael Mendonça França*
|
219
|
-
|
220
|
-
* Remove deprecated file `active_support/core_ext/range/include_range`.
|
221
|
-
|
222
|
-
*Rafael Mendonça França*
|
223
|
-
|
224
|
-
* Remove deprecated file `active_support/core_ext/hash/transform_values`.
|
225
|
-
|
226
|
-
*Rafael Mendonça França*
|
227
|
-
|
228
|
-
* Remove deprecated file `active_support/core_ext/hash/compact`.
|
96
|
+
* Remove deprecate `ActiveSupport::Multibyte::Unicode.default_normalization_form`.
|
229
97
|
|
230
98
|
*Rafael Mendonça França*
|
231
99
|
|
232
|
-
* Remove deprecated
|
100
|
+
* Remove deprecated support to use `Range#include?` to check the inclusion of a value in
|
101
|
+
a date time range is deprecated.
|
233
102
|
|
234
103
|
*Rafael Mendonça França*
|
235
104
|
|
236
|
-
* Remove deprecated
|
105
|
+
* Remove deprecated `URI.parser`.
|
237
106
|
|
238
107
|
*Rafael Mendonça França*
|
239
108
|
|
240
|
-
* Remove deprecated
|
109
|
+
* Remove deprecated `config.active_support.use_sha1_digests`.
|
241
110
|
|
242
111
|
*Rafael Mendonça França*
|
243
112
|
|
244
|
-
*
|
113
|
+
* Invoking `Object#with_options` without a `&block` argument returns the
|
114
|
+
`ActiveSupport::OptionMerger` instance.
|
245
115
|
|
246
|
-
*
|
247
|
-
|
248
|
-
* Remove deprecated `ActiveSupport::LoggerThreadSafeLevel#after_initialize`.
|
116
|
+
*Sean Doyle*
|
249
117
|
|
250
|
-
|
118
|
+
* `Rails.application.executor` hooks can now be called around every test
|
251
119
|
|
252
|
-
|
120
|
+
This helps to better simulate request or job local state being reset around tests and prevents state
|
121
|
+
leaking from one test to another.
|
253
122
|
|
254
|
-
|
255
|
-
|
256
|
-
* Remove deprecated fallback to `I18n.default_local` when `config.i18n.fallbacks` is empty.
|
257
|
-
|
258
|
-
*Rafael Mendonça França*
|
259
|
-
|
260
|
-
* Remove entries from local cache on `RedisCacheStore#delete_matched`
|
261
|
-
|
262
|
-
Fixes #38627
|
263
|
-
|
264
|
-
*ojab*
|
265
|
-
|
266
|
-
* Speed up `ActiveSupport::SecurityUtils.fixed_length_secure_compare` by using
|
267
|
-
`OpenSSL.fixed_length_secure_compare`, if available.
|
268
|
-
|
269
|
-
*Nate Matykiewicz*
|
270
|
-
|
271
|
-
* `ActiveSupport::Cache::MemCacheStore` now checks `ENV["MEMCACHE_SERVERS"]` before falling back to `"localhost:11211"` if configured without any addresses.
|
272
|
-
|
273
|
-
```ruby
|
274
|
-
config.cache_store = :mem_cache_store
|
275
|
-
|
276
|
-
# is now equivalent to
|
277
|
-
|
278
|
-
config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211"
|
123
|
+
However it requires the executor hooks executed in the test environment to be re-entrant.
|
279
124
|
|
280
|
-
|
125
|
+
To enable this, set `config.active_support.executor_around_test_case = true` (this is the default in Rails 7).
|
281
126
|
|
282
|
-
|
283
|
-
```
|
127
|
+
*Jean Boussier*
|
284
128
|
|
285
|
-
|
129
|
+
* `ActiveSupport::DescendantsTracker` now mostly delegate to `Class#descendants` on Ruby 3.1
|
286
130
|
|
287
|
-
|
288
|
-
it allows a subscriber to receive events for methods defined in the subscriber's ancestor class(es).
|
131
|
+
Ruby now provides a fast `Class#descendants` making `ActiveSupport::DescendantsTracker` mostly useless.
|
289
132
|
|
290
|
-
|
291
|
-
class ActionControllerSubscriber < ActiveSupport::Subscriber
|
292
|
-
attach_to :action_controller
|
133
|
+
As a result the following methods are deprecated:
|
293
134
|
|
294
|
-
|
295
|
-
|
296
|
-
end
|
135
|
+
- `ActiveSupport::DescendantsTracker.direct_descendants`
|
136
|
+
- `ActiveSupport::DescendantsTracker#direct_descendants`
|
297
137
|
|
298
|
-
|
299
|
-
info { "Redirected to #{event.payload[:location]}" }
|
300
|
-
end
|
301
|
-
end
|
138
|
+
*Jean Boussier*
|
302
139
|
|
303
|
-
|
304
|
-
# can provide its own instrumentation for certain events in the namespace
|
305
|
-
ActionControllerSubscriber.detach_from(:action_controller)
|
140
|
+
* Fix the `Digest::UUID.uuid_from_hash` behavior for namespace IDs that are different from the ones defined on `Digest::UUID`.
|
306
141
|
|
307
|
-
|
308
|
-
|
142
|
+
The new behavior will be enabled by setting the
|
143
|
+
`config.active_support.use_rfc4122_namespaced_uuids` option to `true`
|
144
|
+
and is the default for new apps.
|
309
145
|
|
310
|
-
|
311
|
-
|
312
|
-
|
146
|
+
The old behavior is the default for upgraded apps and will output a
|
147
|
+
deprecation warning every time a value that is different than one of
|
148
|
+
the constants defined on the `Digest::UUID` extension is used as the
|
149
|
+
namespace ID.
|
313
150
|
|
314
|
-
|
315
|
-
# using its own #start_processing implementation, while retaining ActionControllerSubscriber's instrumentation
|
316
|
-
# for "redirect_to.action_controller" notifications
|
317
|
-
end
|
318
|
-
```
|
151
|
+
*Alex Robbin*, *Erich Soares Machado*, *Eugene Kenny*
|
319
152
|
|
320
|
-
|
153
|
+
* `ActiveSupport::Inflector::Inflections#clear(:acronyms)` is now supported,
|
154
|
+
and `inflector.clear` / `inflector.clear(:all)` also clears acronyms.
|
321
155
|
|
322
|
-
*
|
156
|
+
*Alex Ghiculescu*, *Oliver Peate*
|
323
157
|
|
324
|
-
`config.active_support.use_sha1_digests` is deprecated in favour of `config.active_support.hash_digest_class = ::Digest::SHA1`.
|
325
158
|
|
326
|
-
|
159
|
+
## Rails 7.0.0.alpha2 (September 15, 2021) ##
|
327
160
|
|
328
|
-
*
|
161
|
+
* No changes.
|
329
162
|
|
330
|
-
*Jye Lee*
|
331
163
|
|
332
|
-
|
164
|
+
## Rails 7.0.0.alpha1 (September 15, 2021) ##
|
333
165
|
|
334
|
-
|
166
|
+
* `ActiveSupport::Dependencies` no longer installs a `const_missing` hook. Before this, you could push to the autoload paths and have constants autoloaded. This feature, known as the `classic` autoloader, has been removed.
|
335
167
|
|
336
|
-
*
|
168
|
+
*Xavier Noria*
|
337
169
|
|
338
|
-
*
|
339
|
-
to `read_multi` causing `fetch_multi` to not work properly
|
170
|
+
* Private internal classes of `ActiveSupport::Dependencies` have been deleted, like `ActiveSupport::Dependencies::Reference`, `ActiveSupport::Dependencies::Blamable`, and others.
|
340
171
|
|
341
|
-
*
|
172
|
+
*Xavier Noria*
|
342
173
|
|
343
|
-
*
|
344
|
-
and caused the provided `compression_threshold` to not be respected.
|
174
|
+
* The private API of `ActiveSupport::Dependencies` has been deleted. That includes methods like `hook!`, `unhook!`, `depend_on`, `require_or_load`, `mechanism`, and many others.
|
345
175
|
|
346
|
-
*
|
176
|
+
*Xavier Noria*
|
347
177
|
|
348
|
-
*
|
349
|
-
when reading entries written with `raw: true`.
|
178
|
+
* Improves the performance of `ActiveSupport::NumberHelper` formatters by avoiding the use of exceptions as flow control.
|
350
179
|
|
351
|
-
*
|
180
|
+
*Mike Dalessio*
|
352
181
|
|
353
|
-
*
|
354
|
-
`URI::DEFAULT_PARSER` instead.
|
182
|
+
* Removed rescue block from `ActiveSupport::Cache::RedisCacheStore#handle_exception`
|
355
183
|
|
356
|
-
|
184
|
+
Previously, if you provided a `error_handler` to `redis_cache_store`, any errors thrown by
|
185
|
+
the error handler would be rescued and logged only. Removed the `rescue` clause from `handle_exception`
|
186
|
+
to allow these to be thrown.
|
357
187
|
|
358
|
-
*
|
359
|
-
mode. The method is not deprecated as such (yet), but applications are
|
360
|
-
encouraged to not use it.
|
188
|
+
*Nicholas A. Stuart*
|
361
189
|
|
362
|
-
|
363
|
-
defensive with load order. Just refer to classes and modules normally. If
|
364
|
-
the constant name is dynamic, camelize if needed, and constantize.
|
190
|
+
* Allow entirely opting out of deprecation warnings.
|
365
191
|
|
366
|
-
|
192
|
+
Previously if you did `app.config.active_support.deprecation = :silence`, some work would
|
193
|
+
still be done on each call to `ActiveSupport::Deprecation.warn`. In very hot paths, this could
|
194
|
+
cause performance issues.
|
367
195
|
|
368
|
-
|
196
|
+
Now, you can make `ActiveSupport::Deprecation.warn` a no-op:
|
369
197
|
|
370
198
|
```ruby
|
371
|
-
|
372
|
-
:foo.ends_with?("o") # => true
|
199
|
+
config.active_support.report_deprecations = false
|
373
200
|
```
|
374
201
|
|
375
|
-
|
202
|
+
This is the default in production for new apps. It is the equivalent to:
|
376
203
|
|
377
|
-
* Add override of unary plus for `ActiveSupport::Duration`.
|
378
|
-
|
379
|
-
`+ 1.second` is now identical to `+1.second` to prevent errors
|
380
|
-
where a seemingly innocent change of formatting leads to a change in the code behavior.
|
381
|
-
|
382
|
-
Before:
|
383
204
|
```ruby
|
384
|
-
|
385
|
-
|
386
|
-
(+ 1.second).class
|
387
|
-
# => Integer
|
205
|
+
config.active_support.deprecation = :silence
|
206
|
+
config.active_support.disallowed_deprecation = :silence
|
388
207
|
```
|
389
208
|
|
390
|
-
|
391
|
-
```ruby
|
392
|
-
+1.second.class
|
393
|
-
# => ActiveSupport::Duration
|
394
|
-
(+ 1.second).class
|
395
|
-
# => ActiveSupport::Duration
|
396
|
-
```
|
397
|
-
|
398
|
-
Fixes #39079.
|
399
|
-
|
400
|
-
*Roman Kushnir*
|
401
|
-
|
402
|
-
* Add subsec to `ActiveSupport::TimeWithZone#inspect`.
|
209
|
+
but will take a more optimised code path.
|
403
210
|
|
404
|
-
|
405
|
-
|
406
|
-
Time.at(1498099140).in_time_zone.inspect
|
407
|
-
# => "Thu, 22 Jun 2017 02:39:00 UTC +00:00"
|
408
|
-
Time.at(1498099140, 123456780, :nsec).in_time_zone.inspect
|
409
|
-
# => "Thu, 22 Jun 2017 02:39:00 UTC +00:00"
|
410
|
-
Time.at(1498099140 + Rational("1/3")).in_time_zone.inspect
|
411
|
-
# => "Thu, 22 Jun 2017 02:39:00 UTC +00:00"
|
412
|
-
|
413
|
-
After:
|
211
|
+
*Alex Ghiculescu*
|
414
212
|
|
415
|
-
|
416
|
-
|
417
|
-
Time.at(1498099140, 123456780, :nsec).in_time_zone.inspect
|
418
|
-
# => "Thu, 22 Jun 2017 02:39:00.123456780 UTC +00:00"
|
419
|
-
Time.at(1498099140 + Rational("1/3")).in_time_zone.inspect
|
420
|
-
# => "Thu, 22 Jun 2017 02:39:00.333333333 UTC +00:00"
|
213
|
+
* Faster tests by parallelizing only when overhead is justified by the number
|
214
|
+
of them.
|
421
215
|
|
422
|
-
|
216
|
+
Running tests in parallel adds overhead in terms of database
|
217
|
+
setup and fixture loading. Now, Rails will only parallelize test executions when
|
218
|
+
there are enough tests to make it worth it.
|
423
219
|
|
424
|
-
|
220
|
+
This threshold is 50 by default, and is configurable via config setting in
|
221
|
+
your test.rb:
|
425
222
|
|
426
223
|
```ruby
|
427
|
-
|
224
|
+
config.active_support.test_parallelization_threshold = 100
|
428
225
|
```
|
429
226
|
|
430
|
-
|
431
|
-
|
432
|
-
* Align `Range#cover?` extension behavior with Ruby behavior for backwards ranges.
|
433
|
-
|
434
|
-
`(1..10).cover?(5..3)` now returns `false`, as it does in plain Ruby.
|
435
|
-
|
436
|
-
Also update `#include?` and `#===` behavior to match.
|
227
|
+
It's also configurable at the test case level:
|
437
228
|
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
can be controlled with the
|
444
|
-
`ActiveSupport.utc_to_local_returns_utc_offset_times` config.
|
445
|
-
|
446
|
-
New Rails 6.1 apps have it enabled by default, existing apps can upgrade
|
447
|
-
via the config in config/initializers/new_framework_defaults_6_1.rb
|
448
|
-
|
449
|
-
See the `utc_to_local_returns_utc_offset_times` documentation for details.
|
450
|
-
|
451
|
-
*Phil Ross*, *Jared Beck*
|
452
|
-
|
453
|
-
* Add Date and Time `#yesterday?` and `#tomorrow?` alongside `#today?`.
|
454
|
-
|
455
|
-
Aliased to `#prev_day?` and `#next_day?` to match the existing `#prev/next_day` methods.
|
456
|
-
|
457
|
-
*Jatin Dhankhar*
|
229
|
+
```ruby
|
230
|
+
class ActiveSupport::TestCase
|
231
|
+
parallelize threshold: 100
|
232
|
+
end
|
233
|
+
```
|
458
234
|
|
459
|
-
*
|
235
|
+
*Jorge Manrubia*
|
460
236
|
|
461
|
-
|
237
|
+
* OpenSSL constants are now used for Digest computations.
|
462
238
|
|
463
|
-
*
|
239
|
+
*Dirkjan Bussink*
|
464
240
|
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
and act accordingly.
|
241
|
+
* `TimeZone.iso8601` now accepts valid ordinal values similar to Ruby's `Date._iso8601` method.
|
242
|
+
A valid ordinal value will be converted to an instance of `TimeWithZone` using the `:year`
|
243
|
+
and `:yday` fragments returned from `Date._iso8601`.
|
469
244
|
|
470
245
|
```ruby
|
471
|
-
|
472
|
-
|
473
|
-
before_create { throw(:abort) }
|
474
|
-
|
475
|
-
def halted_callback_hook(filter, callback_name)
|
476
|
-
Rails.logger.info("Book couldn't be #{callback_name}d")
|
477
|
-
end
|
478
|
-
|
479
|
-
Book.create # => "Book couldn't be created"
|
480
|
-
book.save # => "Book couldn't be saved"
|
481
|
-
end
|
246
|
+
twz = ActiveSupport::TimeZone["Eastern Time (US & Canada)"].iso8601("21087")
|
247
|
+
twz.to_a[0, 6] == [0, 0, 0, 28, 03, 2021]
|
482
248
|
```
|
483
249
|
|
484
|
-
*
|
250
|
+
*Steve Laing*
|
485
251
|
|
486
|
-
*
|
487
|
-
|
488
|
-
|
252
|
+
* `Time#change` and methods that call it (e.g. `Time#advance`) will now
|
253
|
+
return a `Time` with the timezone argument provided, if the caller was
|
254
|
+
initialized with a timezone argument.
|
489
255
|
|
490
|
-
|
491
|
-
extend ActiveSupport::Concern
|
256
|
+
Fixes [#42467](https://github.com/rails/rails/issues/42467).
|
492
257
|
|
493
|
-
|
494
|
-
prepended do
|
495
|
-
end
|
496
|
-
end
|
258
|
+
*Alex Ghiculescu*
|
497
259
|
|
498
|
-
|
499
|
-
prepend Imposter
|
500
|
-
end
|
260
|
+
* Allow serializing any module or class to JSON by name.
|
501
261
|
|
502
|
-
|
503
|
-
updated: `concerning :Imposter, prepend: true do`.
|
262
|
+
*Tyler Rick*, *Zachary Scott*
|
504
263
|
|
505
|
-
|
264
|
+
* Raise `ActiveSupport::EncryptedFile::MissingKeyError` when the
|
265
|
+
`RAILS_MASTER_KEY` environment variable is blank (e.g. `""`).
|
506
266
|
|
507
|
-
*
|
508
|
-
in a date time range. It is recommended to use `Range#cover?` method
|
509
|
-
instead of `Range#include?` to check the inclusion of a value
|
510
|
-
in a date time range.
|
267
|
+
*Sunny Ripert*
|
511
268
|
|
512
|
-
|
269
|
+
* The `from:` option is added to `ActiveSupport::TestCase#assert_no_changes`.
|
513
270
|
|
514
|
-
|
271
|
+
It permits asserting on the initial value that is expected not to change.
|
515
272
|
|
516
273
|
```ruby
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
number_to_human_size(483989, precision: 2, round_mode: :up) # => "480 KB"
|
521
|
-
number_to_human(489939, precision: 2, round_mode: :floor) # => "480 Thousand"
|
522
|
-
|
523
|
-
485000.to_s(:human, precision: 2, round_mode: :half_even) # => "480 Thousand"
|
274
|
+
assert_no_changes -> { Status.all_good? }, from: true do
|
275
|
+
post :create, params: { status: { ok: true } }
|
276
|
+
end
|
524
277
|
```
|
525
278
|
|
526
|
-
*
|
527
|
-
|
528
|
-
* `Array#to_sentence` no longer returns a frozen string.
|
529
|
-
|
530
|
-
Before:
|
531
|
-
|
532
|
-
['one', 'two'].to_sentence.frozen?
|
533
|
-
# => true
|
534
|
-
|
535
|
-
After:
|
536
|
-
|
537
|
-
['one', 'two'].to_sentence.frozen?
|
538
|
-
# => false
|
539
|
-
|
540
|
-
*Nicolas Dular*
|
279
|
+
*George Claghorn*
|
541
280
|
|
542
|
-
*
|
543
|
-
This keeps the parser and serializer on the same page.
|
281
|
+
* Deprecate `ActiveSupport::SafeBuffer`'s incorrect implicit conversion of objects into string.
|
544
282
|
|
545
|
-
|
546
|
-
|
547
|
-
|
283
|
+
Except for a few methods like `String#%`, objects must implement `#to_str`
|
284
|
+
to be implicitly converted to a String in string operations. In some
|
285
|
+
circumstances `ActiveSupport::SafeBuffer` was incorrectly calling the
|
286
|
+
explicit conversion method (`#to_s`) on them. This behavior is now
|
287
|
+
deprecated.
|
548
288
|
|
549
|
-
|
550
|
-
# P11DT13H46M40S
|
289
|
+
*Jean Boussier*
|
551
290
|
|
552
|
-
|
553
|
-
# 11 days, 13 hours, 46 minutes, and 40 seconds
|
291
|
+
* Allow nested access to keys on `Rails.application.credentials`.
|
554
292
|
|
555
|
-
|
556
|
-
# 1 week
|
293
|
+
Previously only top level keys in `credentials.yml.enc` could be accessed with method calls. Now any key can.
|
557
294
|
|
558
|
-
|
559
|
-
# P1W
|
295
|
+
For example, given these secrets:
|
560
296
|
|
561
|
-
|
562
|
-
|
297
|
+
```yml
|
298
|
+
aws:
|
299
|
+
access_key_id: 123
|
300
|
+
secret_access_key: 345
|
563
301
|
```
|
564
302
|
|
565
|
-
|
566
|
-
|
567
|
-
* Add block support to `ActiveSupport::Testing::TimeHelpers#travel_back`.
|
568
|
-
|
569
|
-
*Tim Masliuchenko*
|
303
|
+
`Rails.application.credentials.aws.access_key_id` will now return the same thing as
|
304
|
+
`Rails.application.credentials.aws[:access_key_id]`.
|
570
305
|
|
571
|
-
*
|
572
|
-
`ActiveSupport.parse_json_times = true`.
|
573
|
-
|
574
|
-
*Christian Gregg*
|
306
|
+
*Alex Ghiculescu*
|
575
307
|
|
576
|
-
*
|
308
|
+
* Added a faster and more compact `ActiveSupport::Cache` serialization format.
|
577
309
|
|
578
|
-
|
310
|
+
It can be enabled with `config.active_support.cache_format_version = 7.0` or
|
311
|
+
`config.load_defaults 7.0`. Regardless of the configuration Active Support
|
312
|
+
7.0 can read cache entries serialized by Active Support 6.1 which allows to
|
313
|
+
upgrade without invalidating the cache. However Rails 6.1 can't read the
|
314
|
+
new format, so all readers must be upgraded before the new format is enabled.
|
579
315
|
|
580
|
-
*
|
581
|
-
and endless range targets.
|
316
|
+
*Jean Boussier*
|
582
317
|
|
583
|
-
|
318
|
+
* Add `Enumerable#sole`, per `ActiveRecord::FinderMethods#sole`. Returns the
|
319
|
+
sole item of the enumerable, raising if no items are found, or if more than
|
320
|
+
one is.
|
584
321
|
|
585
|
-
*
|
322
|
+
*Asherah Connor*
|
586
323
|
|
587
|
-
|
324
|
+
* Freeze `ActiveSupport::Duration#parts` and remove writer methods.
|
588
325
|
|
589
|
-
|
590
|
-
`ActiveSupport::Duration` unless `value` is of type `Numeric`.
|
326
|
+
Durations are meant to be value objects and should not be mutated.
|
591
327
|
|
592
|
-
|
593
|
-
`ActiveSupport::Duration` comparisons would fail confusingly
|
594
|
-
or return unexpected results when comparing durations built from instances of `String`.
|
328
|
+
*Andrew White*
|
595
329
|
|
596
|
-
|
330
|
+
* Fix `ActiveSupport::TimeZone#utc_to_local` with fractional seconds.
|
597
331
|
|
598
|
-
|
599
|
-
|
600
|
-
|
332
|
+
When `utc_to_local_returns_utc_offset_times` is false and the time
|
333
|
+
instance had fractional seconds the new UTC time instance was out by
|
334
|
+
a factor of 1,000,000 as the `Time.utc` constructor takes a usec
|
335
|
+
value and not a fractional second value.
|
601
336
|
|
602
|
-
|
603
|
-
# => false
|
337
|
+
*Andrew White*
|
604
338
|
|
605
|
-
|
606
|
-
# => false
|
339
|
+
* Add `expires_at` argument to `ActiveSupport::Cache` `write` and `fetch` to set a cache entry TTL as an absolute time.
|
607
340
|
|
608
|
-
|
609
|
-
|
341
|
+
```ruby
|
342
|
+
Rails.cache.write(key, value, expires_at: Time.now.at_end_of_hour)
|
343
|
+
```
|
610
344
|
|
611
|
-
|
612
|
-
# => ArgumentError (comparison of String with ActiveSupport::Duration failed)
|
345
|
+
*Jean Boussier*
|
613
346
|
|
614
|
-
|
347
|
+
* Deprecate `ActiveSupport::TimeWithZone.name` so that from Rails 7.1 it will use the default implementation.
|
615
348
|
|
616
|
-
|
617
|
-
# => TypeError (can't build an ActiveSupport::Duration from a String)
|
349
|
+
*Andrew White*
|
618
350
|
|
619
|
-
|
351
|
+
* Deprecates Rails custom `Enumerable#sum` and `Array#sum` in favor of Ruby's native implementation which
|
352
|
+
is considerably faster.
|
620
353
|
|
621
|
-
|
354
|
+
Ruby requires an initializer for non-numeric type as per examples below:
|
622
355
|
|
623
|
-
|
356
|
+
```ruby
|
357
|
+
%w[foo bar].sum('')
|
358
|
+
# instead of %w[foo bar].sum
|
624
359
|
|
625
|
-
|
626
|
-
|
360
|
+
[[1, 2], [3, 4, 5]].sum([])
|
361
|
+
# instead of [[1, 2], [3, 4, 5]].sum
|
362
|
+
```
|
627
363
|
|
628
|
-
*
|
364
|
+
*Alberto Mota*
|
629
365
|
|
630
|
-
*
|
366
|
+
* Tests parallelization is now disabled when running individual files to prevent the setup overhead.
|
631
367
|
|
632
|
-
|
633
|
-
thread_mattr_reader :client, default: Api::Client.new
|
634
|
-
end
|
368
|
+
It can still be enforced if the environment variable `PARALLEL_WORKERS` is present and set to a value greater than 1.
|
635
369
|
|
636
|
-
*
|
370
|
+
*Ricardo Díaz*
|
637
371
|
|
638
|
-
*
|
639
|
-
an Enumerable (also `compact_blank!` on Hash, Array, ActionController::Parameters).
|
372
|
+
* Fix proxying keyword arguments in `ActiveSupport::CurrentAttributes`.
|
640
373
|
|
641
|
-
*
|
374
|
+
*Marcin Kołodziej*
|
642
375
|
|
643
|
-
*
|
376
|
+
* Add `Enumerable#maximum` and `Enumerable#minimum` to easily calculate the maximum or minimum from extracted
|
377
|
+
elements of an enumerable.
|
644
378
|
|
645
|
-
|
646
|
-
|
379
|
+
```ruby
|
380
|
+
payments = [Payment.new(5), Payment.new(15), Payment.new(10)]
|
647
381
|
|
648
|
-
|
382
|
+
payments.minimum(:price) # => 5
|
383
|
+
payments.maximum(:price) # => 15
|
384
|
+
```
|
649
385
|
|
650
|
-
|
651
|
-
|
652
|
-
puts "Main is debug? #{logger.debug?}"
|
386
|
+
This also allows passing enumerables to `fresh_when` and `stale?` in Action Controller.
|
387
|
+
See PR [#41404](https://github.com/rails/rails/pull/41404) for an example.
|
653
388
|
|
654
|
-
|
655
|
-
logger.local_level = 0
|
656
|
-
puts "Thread is debug? #{logger.debug?}"
|
657
|
-
}.resume
|
389
|
+
*Ayrton De Craene*
|
658
390
|
|
659
|
-
|
391
|
+
* `ActiveSupport::Cache::MemCacheStore` now accepts an explicit `nil` for its `addresses` argument.
|
660
392
|
|
661
|
-
|
393
|
+
```ruby
|
394
|
+
config.cache_store = :mem_cache_store, nil
|
662
395
|
|
663
|
-
|
664
|
-
Thread is debug? true
|
665
|
-
Main is debug? true
|
396
|
+
# is now equivalent to
|
666
397
|
|
667
|
-
|
398
|
+
config.cache_store = :mem_cache_store
|
668
399
|
|
669
|
-
|
670
|
-
Thread is debug? true
|
671
|
-
Main is debug? false
|
400
|
+
# and is also equivalent to
|
672
401
|
|
673
|
-
|
402
|
+
config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211"
|
674
403
|
|
675
|
-
|
404
|
+
# which is the fallback behavior of Dalli
|
405
|
+
```
|
676
406
|
|
677
|
-
|
678
|
-
passed at the constructor level.
|
407
|
+
This helps those migrating from `:dalli_store`, where an explicit `nil` was permitted.
|
679
408
|
|
680
|
-
|
409
|
+
*Michael Overmeyer*
|
681
410
|
|
682
|
-
|
683
|
-
crypt.decrypt_and_verify(encrypted_message, on_rotation: proc { ... })
|
684
|
-
crypt.decrypt_and_verify(another_encrypted_message, on_rotation: proc { ... })
|
411
|
+
* Add `Enumerable#in_order_of` to put an Enumerable in a certain order by a key.
|
685
412
|
|
686
|
-
|
413
|
+
*DHH*
|
687
414
|
|
688
|
-
|
689
|
-
|
690
|
-
crypt.decrypt_and_verify(another_encrypted_message)
|
415
|
+
* `ActiveSupport::Inflector.camelize` behaves expected when provided a symbol `:upper` or `:lower` argument. Matches
|
416
|
+
`String#camelize` behavior.
|
691
417
|
|
692
|
-
*
|
418
|
+
*Alex Ghiculescu*
|
693
419
|
|
694
|
-
* `
|
695
|
-
|
696
|
-
the user to specify they want `nil` returned in this case.
|
420
|
+
* Raises an `ArgumentError` when the first argument of `ActiveSupport::Notification.subscribe` is
|
421
|
+
invalid.
|
697
422
|
|
698
|
-
*
|
423
|
+
*Vipul A M*
|
699
424
|
|
700
|
-
* `
|
701
|
-
and a frozen string if it were long enough to be truncated. Now truncate will
|
702
|
-
consistently return an unfrozen string regardless. This behavior is consistent
|
703
|
-
with `gsub` and `strip`.
|
425
|
+
* `HashWithIndifferentAccess#deep_transform_keys` now returns a `HashWithIndifferentAccess` instead of a `Hash`.
|
704
426
|
|
705
|
-
|
427
|
+
*Nathaniel Woodthorpe*
|
706
428
|
|
707
|
-
|
708
|
-
# => true
|
709
|
-
'foobar'.truncate(6).frozen?
|
710
|
-
# => false
|
429
|
+
* Consume dalli’s `cache_nils` configuration as `ActiveSupport::Cache`'s `skip_nil` when using `MemCacheStore`.
|
711
430
|
|
712
|
-
|
431
|
+
*Ritikesh G*
|
713
432
|
|
714
|
-
|
715
|
-
# => false
|
716
|
-
'foobar'.truncate(6).frozen?
|
717
|
-
# => false
|
433
|
+
* Add `RedisCacheStore#stats` method similar to `MemCacheStore#stats`. Calls `redis#info` internally.
|
718
434
|
|
719
|
-
*
|
435
|
+
*Ritikesh G*
|
720
436
|
|
721
437
|
|
722
|
-
Please check [6-
|
438
|
+
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/activesupport/CHANGELOG.md) for previous changes.
|