activesupport 7.2.4 → 8.0.0.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +41 -431
- data/README.rdoc +1 -1
- data/lib/active_support/backtrace_cleaner.rb +2 -2
- data/lib/active_support/benchmark.rb +21 -0
- data/lib/active_support/benchmarkable.rb +3 -2
- data/lib/active_support/broadcast_logger.rb +74 -61
- data/lib/active_support/cache/file_store.rb +14 -4
- data/lib/active_support/cache/mem_cache_store.rb +15 -16
- data/lib/active_support/cache/memory_store.rb +9 -5
- data/lib/active_support/cache/null_store.rb +2 -2
- data/lib/active_support/cache/redis_cache_store.rb +6 -3
- data/lib/active_support/cache/strategy/local_cache.rb +20 -56
- data/lib/active_support/cache.rb +17 -12
- data/lib/active_support/callbacks.rb +3 -5
- data/lib/active_support/class_attribute.rb +26 -0
- data/lib/active_support/code_generator.rb +9 -0
- data/lib/active_support/concurrency/share_lock.rb +0 -1
- data/lib/active_support/configuration_file.rb +15 -6
- data/lib/active_support/core_ext/benchmark.rb +6 -10
- data/lib/active_support/core_ext/class/attribute.rb +12 -21
- data/lib/active_support/core_ext/date/conversions.rb +2 -0
- data/lib/active_support/core_ext/date_and_time/compatibility.rb +2 -2
- data/lib/active_support/core_ext/date_time/conversions.rb +2 -4
- data/lib/active_support/core_ext/enumerable.rb +13 -20
- data/lib/active_support/core_ext/erb/util.rb +2 -2
- data/lib/active_support/core_ext/hash/except.rb +0 -12
- data/lib/active_support/core_ext/module/introspection.rb +0 -3
- data/lib/active_support/core_ext/object/json.rb +19 -15
- data/lib/active_support/core_ext/object/try.rb +2 -2
- data/lib/active_support/core_ext/range.rb +0 -1
- data/lib/active_support/core_ext/securerandom.rb +8 -24
- data/lib/active_support/core_ext/string/filters.rb +3 -3
- data/lib/active_support/core_ext/string/multibyte.rb +3 -3
- data/lib/active_support/core_ext/string/output_safety.rb +1 -3
- data/lib/active_support/core_ext/time/calculations.rb +14 -2
- data/lib/active_support/core_ext/time/compatibility.rb +1 -9
- data/lib/active_support/core_ext/time/conversions.rb +2 -0
- data/lib/active_support/core_ext/time/zones.rb +1 -1
- data/lib/active_support/current_attributes.rb +7 -14
- data/lib/active_support/deprecation.rb +1 -1
- data/lib/active_support/encrypted_configuration.rb +20 -2
- data/lib/active_support/error_reporter.rb +27 -6
- data/lib/active_support/execution_wrapper.rb +1 -1
- data/lib/active_support/file_update_checker.rb +1 -1
- data/lib/active_support/gem_version.rb +4 -4
- data/lib/active_support/hash_with_indifferent_access.rb +31 -31
- data/lib/active_support/i18n_railtie.rb +19 -10
- data/lib/active_support/inflector/methods.rb +2 -2
- data/lib/active_support/isolated_execution_state.rb +0 -1
- data/lib/active_support/json/decoding.rb +2 -2
- data/lib/active_support/json/encoding.rb +8 -26
- data/lib/active_support/lazy_load_hooks.rb +1 -1
- data/lib/active_support/message_encryptors.rb +2 -2
- data/lib/active_support/message_pack/extensions.rb +1 -1
- data/lib/active_support/message_verifier.rb +0 -9
- data/lib/active_support/message_verifiers.rb +3 -5
- data/lib/active_support/messages/rotator.rb +0 -5
- data/lib/active_support/multibyte/chars.rb +1 -4
- data/lib/active_support/number_helper/number_converter.rb +1 -1
- data/lib/active_support/number_helper/number_to_delimited_converter.rb +5 -18
- data/lib/active_support/number_helper.rb +22 -0
- data/lib/active_support/railtie.rb +4 -0
- data/lib/active_support/tagged_logging.rb +5 -0
- data/lib/active_support/testing/assertions.rb +72 -21
- data/lib/active_support/testing/isolation.rb +0 -2
- data/lib/active_support/testing/parallelization/server.rb +2 -15
- data/lib/active_support/testing/parallelization/worker.rb +2 -2
- data/lib/active_support/testing/parallelization.rb +1 -12
- data/lib/active_support/testing/strict_warnings.rb +43 -0
- data/lib/active_support/testing/time_helpers.rb +2 -1
- data/lib/active_support/time_with_zone.rb +22 -13
- data/lib/active_support/values/time_zone.rb +17 -15
- data/lib/active_support/xml_mini.rb +0 -2
- data/lib/active_support.rb +10 -2
- metadata +27 -20
- data/lib/active_support/core_ext/range/sole.rb +0 -17
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 492cd4c9d2ec59d97060d7949b3b68badc089d97ea467a30a0e6614d65e69c21
|
|
4
|
+
data.tar.gz: 98af51f7ec102b694fbd17f636cdf942b965a9a845561f05b1569b07efc56747
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b720480df1c4117bf85c0f9066f7015dc750ca1279bba4c07a66a429effa06101adab40eda21f76c6d14ee1c57d46b6aff5cffd494e0e55d18600fe764c9d0e5
|
|
7
|
+
data.tar.gz: 13d40213e5c9720bda46e71d696a6f011547ca95ade865061df922cc9abd5adfbf6a0daa651e0732314dfb67faf3c9ad3fde39bb3490f4e3fd7577fb24b8221b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,203 +1,4 @@
|
|
|
1
|
-
## Rails
|
|
2
|
-
|
|
3
|
-
* Improve `number_to_delimited` performance when `delimiter_pattern` is not specified.
|
|
4
|
-
|
|
5
|
-
*Shinichi Maeshima*
|
|
6
|
-
|
|
7
|
-
* Silence Dalli 4.0+ warning when using `ActiveSupport::Cache::MemCacheStore`.
|
|
8
|
-
|
|
9
|
-
*zzak*
|
|
10
|
-
|
|
11
|
-
* Fix `ActiveSupport::Inflector.humanize` with international characters.
|
|
12
|
-
|
|
13
|
-
```ruby
|
|
14
|
-
ActiveSupport::Inflector.humanize("áÉÍÓÚ") # => "Áéíóú"
|
|
15
|
-
ActiveSupport::Inflector.humanize("аБВГДЕ") # => "Абвгде"
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
*Jose Luis Duran*
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
## Rails 7.2.3.2 (July 29, 2026) ##
|
|
22
|
-
|
|
23
|
-
* No changes.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
## Rails 7.2.3.1 (March 23, 2026) ##
|
|
27
|
-
|
|
28
|
-
* Reject scientific notation in NumberConverter
|
|
29
|
-
|
|
30
|
-
[CVE-2026-33176]
|
|
31
|
-
|
|
32
|
-
*Jean Boussier*
|
|
33
|
-
|
|
34
|
-
* Fix `SafeBuffer#%` to preserve unsafe status
|
|
35
|
-
|
|
36
|
-
[CVE-2026-33170]
|
|
37
|
-
|
|
38
|
-
*Jean Boussier*
|
|
39
|
-
|
|
40
|
-
* Improve performance of NumberToDelimitedConverter
|
|
41
|
-
|
|
42
|
-
[CVE-2026-33169]
|
|
43
|
-
|
|
44
|
-
*Jean Boussier*
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
## Rails 7.2.3 (October 28, 2025) ##
|
|
48
|
-
|
|
49
|
-
* Fix `Enumerable#sole` to return the full tuple instead of just the first element of the tuple.
|
|
50
|
-
|
|
51
|
-
*Olivier Bellone*
|
|
52
|
-
|
|
53
|
-
* Fix parallel tests hanging when worker processes die abruptly.
|
|
54
|
-
|
|
55
|
-
Previously, if a worker process was killed (e.g., OOM killed, `kill -9`) during parallel
|
|
56
|
-
test execution, the test suite would hang forever waiting for the dead worker.
|
|
57
|
-
|
|
58
|
-
*Joshua Young*
|
|
59
|
-
|
|
60
|
-
* `ActiveSupport::FileUpdateChecker` does not depend on `Time.now` to prevent unnecessary reloads with time travel test helpers
|
|
61
|
-
|
|
62
|
-
*Jan Grodowski*
|
|
63
|
-
|
|
64
|
-
* Fix `ActiveSupport::BroadcastLogger` from executing a block argument for each logger (tagged, info, etc.).
|
|
65
|
-
|
|
66
|
-
*Jared Armstrong*
|
|
67
|
-
|
|
68
|
-
* Fix `ActiveSupport::HashWithIndifferentAccess#transform_keys!` removing defaults.
|
|
69
|
-
|
|
70
|
-
*Hartley McGuire*
|
|
71
|
-
|
|
72
|
-
* Fix `ActiveSupport::HashWithIndifferentAccess#tranform_keys!` to handle collisions.
|
|
73
|
-
|
|
74
|
-
If the transformation would result in a key equal to another not yet transformed one,
|
|
75
|
-
it would result in keys being lost.
|
|
76
|
-
|
|
77
|
-
Before:
|
|
78
|
-
|
|
79
|
-
```ruby
|
|
80
|
-
>> {a: 1, b: 2}.with_indifferent_access.transform_keys!(&:succ)
|
|
81
|
-
=> {"c" => 1}
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
After:
|
|
85
|
-
|
|
86
|
-
```ruby
|
|
87
|
-
>> {a: 1, b: 2}.with_indifferent_access.transform_keys!(&:succ)
|
|
88
|
-
=> {"c" => 1, "d" => 2}
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
*Jason T Johnson*, *Jean Boussier*
|
|
92
|
-
|
|
93
|
-
* Fix `ActiveSupport::Cache::MemCacheStore#read_multi` to handle network errors.
|
|
94
|
-
|
|
95
|
-
This method specifically wasn't handling network errors like other codepaths.
|
|
96
|
-
|
|
97
|
-
*Alessandro Dal Grande*
|
|
98
|
-
|
|
99
|
-
* Fix Active Support Cache `fetch_multi` when local store is active.
|
|
100
|
-
|
|
101
|
-
`fetch_multi` now properly yield to the provided block for missing entries
|
|
102
|
-
that have been recorded as such in the local store.
|
|
103
|
-
|
|
104
|
-
*Jean Boussier*
|
|
105
|
-
|
|
106
|
-
* Fix execution wrapping to report all exceptions, including `Exception`.
|
|
107
|
-
|
|
108
|
-
If a more serious error like `SystemStackError` or `NoMemoryError` happens,
|
|
109
|
-
the error reporter should be able to report these kinds of exceptions.
|
|
110
|
-
|
|
111
|
-
*Gannon McGibbon*
|
|
112
|
-
|
|
113
|
-
* Fix `RedisCacheStore` and `MemCacheStore` to also handle connection pool related errors.
|
|
114
|
-
|
|
115
|
-
These errors are rescued and reported to `Rails.error`.
|
|
116
|
-
|
|
117
|
-
*Jean Boussier*
|
|
118
|
-
|
|
119
|
-
* Fix `ActiveSupport::Cache#read_multi` to respect version expiry when using local cache.
|
|
120
|
-
|
|
121
|
-
*zzak*
|
|
122
|
-
|
|
123
|
-
* Fix `ActiveSupport::MessageVerifier` and `ActiveSupport::MessageEncryptor` configuration of `on_rotation` callback.
|
|
124
|
-
|
|
125
|
-
```ruby
|
|
126
|
-
verifier.rotate(old_secret).on_rotation { ... }
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
Now both work as documented.
|
|
130
|
-
|
|
131
|
-
*Jean Boussier*
|
|
132
|
-
|
|
133
|
-
* Fix `ActiveSupport::MessageVerifier` to always be able to verify both URL-safe and URL-unsafe payloads.
|
|
134
|
-
|
|
135
|
-
This is to allow transitioning seemlessly from either configuration without immediately invalidating
|
|
136
|
-
all previously generated signed messages.
|
|
137
|
-
|
|
138
|
-
*Jean Boussier*, *Florent Beaurain*, *Ali Sepehri*
|
|
139
|
-
|
|
140
|
-
* Fix `cache.fetch` to honor the provided expiry when `:race_condition_ttl` is used.
|
|
141
|
-
|
|
142
|
-
```ruby
|
|
143
|
-
cache.fetch("key", expires_in: 1.hour, race_condition_ttl: 5.second) do
|
|
144
|
-
"something"
|
|
145
|
-
end
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
In the above example, the final cache entry would have a 10 seconds TTL instead
|
|
149
|
-
of the requested 1 hour.
|
|
150
|
-
|
|
151
|
-
*Dhia*
|
|
152
|
-
|
|
153
|
-
* Better handle procs with splat arguments in `set_callback`.
|
|
154
|
-
|
|
155
|
-
*Radamés Roriz*
|
|
156
|
-
|
|
157
|
-
* Fix `String#mb_chars` to not mutate the receiver.
|
|
158
|
-
|
|
159
|
-
Previously it would call `force_encoding` on the receiver,
|
|
160
|
-
now it dups the receiver first.
|
|
161
|
-
|
|
162
|
-
*Jean Boussier*
|
|
163
|
-
|
|
164
|
-
* Improve `ErrorSubscriber` to also mark error causes as reported.
|
|
165
|
-
|
|
166
|
-
This avoid some cases of errors being reported twice, notably in views because of how
|
|
167
|
-
errors are wrapped in `ActionView::Template::Error`.
|
|
168
|
-
|
|
169
|
-
*Jean Boussier*
|
|
170
|
-
|
|
171
|
-
* Fix `Module#module_parent_name` to return the correct name after the module has been named.
|
|
172
|
-
|
|
173
|
-
When called on an anonymous module, the return value wouldn't change after the module was given a name
|
|
174
|
-
later by being assigned to a constant.
|
|
175
|
-
|
|
176
|
-
```ruby
|
|
177
|
-
mod = Module.new
|
|
178
|
-
mod.module_parent_name # => "Object"
|
|
179
|
-
MyModule::Something = mod
|
|
180
|
-
mod.module_parent_name # => "MyModule"
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
*Jean Boussier*
|
|
184
|
-
|
|
185
|
-
* Fix a bug in `ERB::Util.tokenize` that causes incorrect tokenization when ERB tags are preceeded by multibyte characters.
|
|
186
|
-
|
|
187
|
-
*Martin Emde*
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
## Rails 7.2.2.2 (August 13, 2025) ##
|
|
191
|
-
|
|
192
|
-
* No changes.
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
## Rails 7.2.2.1 (December 10, 2024) ##
|
|
196
|
-
|
|
197
|
-
* No changes.
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
## Rails 7.2.2 (October 30, 2024) ##
|
|
1
|
+
## Rails 8.0.0.beta1 (September 26, 2024) ##
|
|
201
2
|
|
|
202
3
|
* Include options when instrumenting `ActiveSupport::Cache::Store#delete` and `ActiveSupport::Cache::Store#delete_multi`.
|
|
203
4
|
|
|
@@ -207,272 +8,81 @@
|
|
|
207
8
|
|
|
208
9
|
*John Hawthorn*, *Abeid Ahmed*
|
|
209
10
|
|
|
11
|
+
* Deprecate `Benchmark.ms` core extension.
|
|
210
12
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
* No changes.
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
## Rails 7.2.1.1 (October 15, 2024) ##
|
|
217
|
-
|
|
218
|
-
* No changes.
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
## Rails 7.2.1 (August 22, 2024) ##
|
|
222
|
-
|
|
223
|
-
* No changes.
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
## Rails 7.2.0 (August 09, 2024) ##
|
|
227
|
-
|
|
228
|
-
* Fix `delegate_missing_to allow_nil: true` when called with implict self
|
|
229
|
-
|
|
230
|
-
```ruby
|
|
231
|
-
class Person
|
|
232
|
-
delegate_missing_to :address, allow_nil: true
|
|
233
|
-
|
|
234
|
-
def address
|
|
235
|
-
nil
|
|
236
|
-
end
|
|
237
|
-
|
|
238
|
-
def berliner?
|
|
239
|
-
city == "Berlin"
|
|
240
|
-
end
|
|
241
|
-
end
|
|
242
|
-
|
|
243
|
-
Person.new.city # => nil
|
|
244
|
-
Person.new.berliner? # undefined local variable or method `city' for an instance of Person (NameError)
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
*Jean Boussier*
|
|
248
|
-
|
|
249
|
-
* Add `logger` as a dependency since it is a bundled gem candidate for Ruby 3.5
|
|
13
|
+
The `benchmark` gem will become bundled in Ruby 3.5
|
|
250
14
|
|
|
251
15
|
*Earlopain*
|
|
252
16
|
|
|
253
|
-
*
|
|
254
|
-
|
|
255
|
-
*Xavier Noria*
|
|
256
|
-
|
|
257
|
-
* Support `duration` type in `ActiveSupport::XmlMini`.
|
|
258
|
-
|
|
259
|
-
*heka1024*
|
|
260
|
-
|
|
261
|
-
* Remove deprecated `ActiveSupport::Notifications::Event#children` and `ActiveSupport::Notifications::Event#parent_of?`.
|
|
262
|
-
|
|
263
|
-
*Rafael Mendonça França*
|
|
264
|
-
|
|
265
|
-
* Remove deprecated support to call the following methods without passing a deprecator:
|
|
266
|
-
|
|
267
|
-
- `deprecate`
|
|
268
|
-
- `deprecate_constant`
|
|
269
|
-
- `ActiveSupport::Deprecation::DeprecatedObjectProxy.new`
|
|
270
|
-
- `ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.new`
|
|
271
|
-
- `ActiveSupport::Deprecation::DeprecatedConstantProxy.new`
|
|
272
|
-
- `assert_deprecated`
|
|
273
|
-
- `assert_not_deprecated`
|
|
274
|
-
- `collect_deprecations`
|
|
275
|
-
|
|
276
|
-
*Rafael Mendonça França*
|
|
277
|
-
|
|
278
|
-
* Remove deprecated `ActiveSupport::Deprecation` delegation to instance.
|
|
279
|
-
|
|
280
|
-
*Rafael Mendonça França*
|
|
281
|
-
|
|
282
|
-
* Remove deprecated `SafeBuffer#clone_empty`.
|
|
283
|
-
|
|
284
|
-
*Rafael Mendonça França*
|
|
285
|
-
|
|
286
|
-
* Remove deprecated `#to_default_s` from `Array`, `Date`, `DateTime` and `Time`.
|
|
287
|
-
|
|
288
|
-
*Rafael Mendonça França*
|
|
289
|
-
|
|
290
|
-
* Remove deprecated support to passing `Dalli::Client` instances to `MemCacheStore`.
|
|
291
|
-
|
|
292
|
-
*Rafael Mendonça França*
|
|
293
|
-
|
|
294
|
-
* Remove deprecated `config.active_support.use_rfc4122_namespaced_uuids`.
|
|
295
|
-
|
|
296
|
-
*Rafael Mendonça França*
|
|
297
|
-
|
|
298
|
-
* Remove deprecated `config.active_support.remove_deprecated_time_with_zone_name`.
|
|
299
|
-
|
|
300
|
-
*Rafael Mendonça França*
|
|
301
|
-
|
|
302
|
-
* Remove deprecated `config.active_support.disable_to_s_conversion`.
|
|
303
|
-
|
|
304
|
-
*Rafael Mendonça França*
|
|
305
|
-
|
|
306
|
-
* Remove deprecated support to bolding log text with positional boolean in `ActiveSupport::LogSubscriber#color`.
|
|
307
|
-
|
|
308
|
-
*Rafael Mendonça França*
|
|
309
|
-
|
|
310
|
-
* Remove deprecated constants `ActiveSupport::LogSubscriber::CLEAR` and `ActiveSupport::LogSubscriber::BOLD`.
|
|
17
|
+
* `ActiveSupport::TimeWithZone#inspect` now uses ISO 8601 style time like `Time#inspect`
|
|
311
18
|
|
|
312
|
-
*
|
|
19
|
+
*John Hawthorn*
|
|
313
20
|
|
|
314
|
-
*
|
|
21
|
+
* `ActiveSupport::ErrorReporter#report` now assigns a backtrace to unraised exceptions.
|
|
315
22
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
* Remove deprecated `:pool_size` and `:pool_timeout` options for the cache storage.
|
|
319
|
-
|
|
320
|
-
*Rafael Mendonça França*
|
|
321
|
-
|
|
322
|
-
* Warn on tests without assertions.
|
|
323
|
-
|
|
324
|
-
`ActiveSupport::TestCase` now warns when tests do not run any assertions.
|
|
325
|
-
This is helpful in detecting broken tests that do not perform intended assertions.
|
|
326
|
-
|
|
327
|
-
*fatkodima*
|
|
328
|
-
|
|
329
|
-
* Support `hexBinary` type in `ActiveSupport::XmlMini`.
|
|
330
|
-
|
|
331
|
-
*heka1024*
|
|
332
|
-
|
|
333
|
-
* Deprecate `ActiveSupport::ProxyObject` in favor of Ruby's built-in `BasicObject`.
|
|
334
|
-
|
|
335
|
-
*Earlopain*
|
|
336
|
-
|
|
337
|
-
* `stub_const` now accepts a `exists: false` parameter to allow stubbing missing constants.
|
|
338
|
-
|
|
339
|
-
*Jean Boussier*
|
|
340
|
-
|
|
341
|
-
* Make `ActiveSupport::BacktraceCleaner` copy filters and silencers on dup and clone.
|
|
342
|
-
|
|
343
|
-
Previously the copy would still share the internal silencers and filters array,
|
|
344
|
-
causing state to leak.
|
|
23
|
+
Previously reporting an un-raised exception would result in an error report without
|
|
24
|
+
a backtrace. Now it automatically generates one.
|
|
345
25
|
|
|
346
26
|
*Jean Boussier*
|
|
347
27
|
|
|
348
|
-
*
|
|
349
|
-
|
|
350
|
-
*Damian Nelson*
|
|
351
|
-
|
|
352
|
-
* Add filename support for `ActiveSupport::Logger.logger_outputs_to?`.
|
|
353
|
-
|
|
354
|
-
```ruby
|
|
355
|
-
logger = Logger.new('/var/log/rails.log')
|
|
356
|
-
ActiveSupport::Logger.logger_outputs_to?(logger, '/var/log/rails.log')
|
|
357
|
-
```
|
|
358
|
-
|
|
359
|
-
*Christian Schmidt*
|
|
360
|
-
|
|
361
|
-
* Include `IPAddr#prefix` when serializing an `IPAddr` using the
|
|
362
|
-
`ActiveSupport::MessagePack` serializer.
|
|
363
|
-
|
|
364
|
-
This change is backward and forward compatible — old payloads can
|
|
365
|
-
still be read, and new payloads will be readable by older versions of Rails.
|
|
366
|
-
|
|
367
|
-
*Taiki Komaba*
|
|
368
|
-
|
|
369
|
-
* Add `default:` support for `ActiveSupport::CurrentAttributes.attribute`.
|
|
370
|
-
|
|
371
|
-
```ruby
|
|
372
|
-
class Current < ActiveSupport::CurrentAttributes
|
|
373
|
-
attribute :counter, default: 0
|
|
374
|
-
end
|
|
375
|
-
```
|
|
376
|
-
|
|
377
|
-
*Sean Doyle*
|
|
378
|
-
|
|
379
|
-
* Yield instance to `Object#with` block.
|
|
380
|
-
|
|
381
|
-
```ruby
|
|
382
|
-
client.with(timeout: 5_000) do |c|
|
|
383
|
-
c.get("/commits")
|
|
384
|
-
end
|
|
385
|
-
```
|
|
386
|
-
|
|
387
|
-
*Sean Doyle*
|
|
388
|
-
|
|
389
|
-
* Use logical core count instead of physical core count to determine the
|
|
390
|
-
default number of workers when parallelizing tests.
|
|
391
|
-
|
|
392
|
-
*Jonathan Hefner*
|
|
393
|
-
|
|
394
|
-
* Fix `Time.now/DateTime.now/Date.today` to return results in a system timezone after `#travel_to`.
|
|
28
|
+
* Add `escape_html_entities` option to `ActiveSupport::JSON.encode`.
|
|
395
29
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
returning results in that remembered timezone. However, the expected
|
|
399
|
-
behavior is to return results in a system timezone.
|
|
400
|
-
|
|
401
|
-
*Aleksei Chernenkov*
|
|
402
|
-
|
|
403
|
-
* Add `ErrorReported#unexpected` to report precondition violations.
|
|
404
|
-
|
|
405
|
-
For example:
|
|
30
|
+
This allows for overriding the global configuration found at
|
|
31
|
+
`ActiveSupport.escape_html_entities_in_json` for specific calls to `to_json`.
|
|
406
32
|
|
|
33
|
+
This should be usable from controllers in the following manner:
|
|
407
34
|
```ruby
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
return false
|
|
35
|
+
class MyController < ApplicationController
|
|
36
|
+
def index
|
|
37
|
+
render json: { hello: "world" }, escape_html_entities: false
|
|
412
38
|
end
|
|
413
|
-
# ...
|
|
414
39
|
end
|
|
415
40
|
```
|
|
416
41
|
|
|
417
|
-
|
|
42
|
+
*Nigel Baillie*
|
|
418
43
|
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
* Make the order of read_multi and write_multi notifications for `Cache::Store#fetch_multi` operations match the order they are executed in.
|
|
422
|
-
|
|
423
|
-
*Adam Renberg Tamm*
|
|
44
|
+
* Raise when using key which can't respond to `#to_sym` in `EncryptedConfiguration`.
|
|
424
45
|
|
|
425
|
-
|
|
46
|
+
As is the case when trying to use an Integer or Float as a key, which is unsupported.
|
|
426
47
|
|
|
427
|
-
|
|
428
|
-
`nil` if there was an error talking to the cache backend, and `false` if the write failed
|
|
429
|
-
for another reason (e.g. the key already exists and `unless_exist: true` was passed).
|
|
430
|
-
|
|
431
|
-
*Sander Verdonschot*
|
|
432
|
-
|
|
433
|
-
* Fix logged cache keys not always matching actual key used by cache action.
|
|
434
|
-
|
|
435
|
-
*Hartley McGuire*
|
|
436
|
-
|
|
437
|
-
* Improve error messages of `assert_changes` and `assert_no_changes`.
|
|
48
|
+
*zzak*
|
|
438
49
|
|
|
439
|
-
|
|
440
|
-
to differentiate nil from empty strings, strings from symbols, etc.
|
|
441
|
-
`assert_no_changes` error messages now surface the actual value.
|
|
50
|
+
* Deprecate addition and since between two `Time` and `ActiveSupport::TimeWithZone`.
|
|
442
51
|
|
|
443
|
-
|
|
52
|
+
Previously adding time instances together such as `10.days.ago + 10.days.ago` or `10.days.ago.since(10.days.ago)` produced a nonsensical future date. This behavior is deprecated and will be removed in Rails 8.1.
|
|
444
53
|
|
|
445
|
-
*
|
|
54
|
+
*Nick Schwaderer*
|
|
446
55
|
|
|
447
|
-
|
|
56
|
+
* Support rfc2822 format for Time#to_fs & Date#to_fs.
|
|
448
57
|
|
|
449
|
-
*
|
|
58
|
+
*Akshay Birajdar*
|
|
450
59
|
|
|
451
|
-
|
|
60
|
+
* Optimize load time for `Railtie#initialize_i18n`. Filter `I18n.load_path`s passed to the file watcher to only those
|
|
61
|
+
under `Rails.root`. Previously the watcher would grab all available locales, including those in gems
|
|
62
|
+
which do not require a watcher because they won't change.
|
|
452
63
|
|
|
453
|
-
*
|
|
64
|
+
*Nick Schwaderer*
|
|
454
65
|
|
|
455
|
-
|
|
66
|
+
* Add a `filter` option to `in_order_of` to prioritize certain values in the sorting without filtering the results
|
|
67
|
+
by these values.
|
|
456
68
|
|
|
457
|
-
*
|
|
69
|
+
*Igor Depolli*
|
|
458
70
|
|
|
459
|
-
|
|
460
|
-
|
|
71
|
+
* Improve error message when using `assert_difference` or `assert_changes` with a
|
|
72
|
+
proc by printing the proc's source code (MRI only).
|
|
461
73
|
|
|
462
|
-
|
|
463
|
-
`SemanticLogger` instance.
|
|
74
|
+
*Richard Böhme*, *Jean Boussier*
|
|
464
75
|
|
|
465
|
-
|
|
76
|
+
* Add a new configuration value `:zone` for `ActiveSupport.to_time_preserves_timezone` and rename the previous `true` value to `:offset`. The new default value is `:zone`.
|
|
466
77
|
|
|
467
|
-
*
|
|
78
|
+
*Jason Kim*, *John Hawthorn*
|
|
468
79
|
|
|
469
|
-
|
|
80
|
+
* Align instrumentation `payload[:key]` in ActiveSupport::Cache to follow the same pattern, with namespaced and normalized keys.
|
|
470
81
|
|
|
471
|
-
*
|
|
82
|
+
*Frederik Erbs Spang Thomsen*
|
|
472
83
|
|
|
473
|
-
|
|
474
|
-
method from the `Hash` class, which was not able to access values using indifferent keys.
|
|
84
|
+
* Fix `travel_to` to set usec 0 when `with_usec` is `false` and the given argument String or DateTime.
|
|
475
85
|
|
|
476
|
-
*
|
|
86
|
+
*mopp*
|
|
477
87
|
|
|
478
|
-
Please check [7-
|
|
88
|
+
Please check [7-2-stable](https://github.com/rails/rails/blob/7-2-stable/activesupport/CHANGELOG.md) for previous changes.
|
data/README.rdoc
CHANGED
|
@@ -35,6 +35,6 @@ Bug reports for the Ruby on \Rails project can be filed here:
|
|
|
35
35
|
|
|
36
36
|
* https://github.com/rails/rails/issues
|
|
37
37
|
|
|
38
|
-
Feature requests should be discussed on the
|
|
38
|
+
Feature requests should be discussed on the rails-core mailing list here:
|
|
39
39
|
|
|
40
40
|
* https://discuss.rubyonrails.org/c/rubyonrails-core
|
|
@@ -18,7 +18,7 @@ module ActiveSupport
|
|
|
18
18
|
#
|
|
19
19
|
# bc = ActiveSupport::BacktraceCleaner.new
|
|
20
20
|
# root = "#{Rails.root}/"
|
|
21
|
-
# bc.add_filter { |line| line.
|
|
21
|
+
# bc.add_filter { |line| line.delete_prefix(root) } # strip the Rails.root prefix
|
|
22
22
|
# bc.add_silencer { |line| /puma|rubygems/.match?(line) } # skip any lines from puma or rubygems
|
|
23
23
|
# bc.clean(exception.backtrace) # perform the cleanup
|
|
24
24
|
#
|
|
@@ -79,7 +79,7 @@ module ActiveSupport
|
|
|
79
79
|
#
|
|
80
80
|
# # Will turn "/my/rails/root/app/models/person.rb" into "app/models/person.rb"
|
|
81
81
|
# root = "#{Rails.root}/"
|
|
82
|
-
# backtrace_cleaner.add_filter { |line| line.
|
|
82
|
+
# backtrace_cleaner.add_filter { |line| line.start_with?(root) ? line.from(root.size) : line }
|
|
83
83
|
def add_filter(&block)
|
|
84
84
|
@filters << block
|
|
85
85
|
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module ActiveSupport
|
|
4
|
+
module Benchmark # :nodoc:
|
|
5
|
+
# Benchmark realtime in the specified time unit. By default,
|
|
6
|
+
# the returned unit is in seconds.
|
|
7
|
+
#
|
|
8
|
+
# ActiveSupport::Benchmark.realtime { sleep 0.1 }
|
|
9
|
+
# # => 0.10007
|
|
10
|
+
#
|
|
11
|
+
# ActiveSupport::Benchmark.realtime(:float_millisecond) { sleep 0.1 }
|
|
12
|
+
# # => 100.07
|
|
13
|
+
#
|
|
14
|
+
# `unit` can be any of the values accepted by Ruby's `Process.clock_gettime`.
|
|
15
|
+
def self.realtime(unit = :float_second, &block)
|
|
16
|
+
time_start = Process.clock_gettime(Process::CLOCK_MONOTONIC, unit)
|
|
17
|
+
yield
|
|
18
|
+
Process.clock_gettime(Process::CLOCK_MONOTONIC, unit) - time_start
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require "active_support/core_ext/benchmark"
|
|
4
3
|
require "active_support/core_ext/hash/keys"
|
|
5
4
|
|
|
6
5
|
module ActiveSupport
|
|
@@ -41,7 +40,9 @@ module ActiveSupport
|
|
|
41
40
|
options[:level] ||= :info
|
|
42
41
|
|
|
43
42
|
result = nil
|
|
44
|
-
ms = Benchmark.
|
|
43
|
+
ms = ActiveSupport::Benchmark.realtime(:float_millisecond) do
|
|
44
|
+
result = options[:silence] ? logger.silence(&block) : yield
|
|
45
|
+
end
|
|
45
46
|
logger.public_send(options[:level], "%s (%.1fms)" % [ message, ms ])
|
|
46
47
|
result
|
|
47
48
|
else
|