activesupport 7.2.2.1 → 8.0.5
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 +277 -151
- 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 +61 -74
- data/lib/active_support/cache/file_store.rb +14 -4
- data/lib/active_support/cache/mem_cache_store.rb +17 -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 +7 -4
- data/lib/active_support/cache/strategy/local_cache.rb +56 -20
- data/lib/active_support/cache.rb +19 -14
- data/lib/active_support/callbacks.rb +8 -5
- data/lib/active_support/class_attribute.rb +33 -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/array/conversions.rb +3 -3
- data/lib/active_support/core_ext/benchmark.rb +7 -9
- data/lib/active_support/core_ext/class/attribute.rb +26 -20
- 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 +4 -2
- data/lib/active_support/core_ext/enumerable.rb +25 -8
- data/lib/active_support/core_ext/erb/util.rb +2 -2
- data/lib/active_support/core_ext/hash/deep_merge.rb +1 -0
- data/lib/active_support/core_ext/hash/except.rb +0 -12
- data/lib/active_support/core_ext/module/attr_internal.rb +3 -4
- data/lib/active_support/core_ext/module/introspection.rb +3 -0
- data/lib/active_support/core_ext/object/json.rb +16 -10
- data/lib/active_support/core_ext/object/to_query.rb +2 -1
- data/lib/active_support/core_ext/object/try.rb +2 -2
- data/lib/active_support/core_ext/range/overlap.rb +3 -3
- data/lib/active_support/core_ext/range/sole.rb +17 -0
- data/lib/active_support/core_ext/range.rb +1 -0
- data/lib/active_support/core_ext/securerandom.rb +24 -8
- data/lib/active_support/core_ext/string/filters.rb +3 -3
- data/lib/active_support/core_ext/string/inflections.rb +1 -1
- data/lib/active_support/core_ext/string/multibyte.rb +2 -2
- data/lib/active_support/core_ext/string/output_safety.rb +3 -1
- data/lib/active_support/core_ext/thread/backtrace/location.rb +2 -7
- data/lib/active_support/core_ext/time/calculations.rb +14 -2
- data/lib/active_support/core_ext/time/compatibility.rb +9 -1
- data/lib/active_support/core_ext/time/conversions.rb +2 -0
- data/lib/active_support/current_attributes.rb +14 -7
- data/lib/active_support/delegation.rb +25 -44
- data/lib/active_support/dependencies.rb +0 -1
- data/lib/active_support/deprecation/reporting.rb +0 -19
- data/lib/active_support/deprecation.rb +1 -1
- data/lib/active_support/duration.rb +14 -10
- data/lib/active_support/encrypted_configuration.rb +20 -2
- data/lib/active_support/error_reporter.rb +36 -3
- data/lib/active_support/evented_file_update_checker.rb +0 -1
- 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 +34 -31
- data/lib/active_support/i18n_railtie.rb +19 -11
- data/lib/active_support/inflector/inflections.rb +2 -1
- data/lib/active_support/inflector/methods.rb +3 -3
- data/lib/active_support/isolated_execution_state.rb +4 -4
- data/lib/active_support/json/decoding.rb +4 -2
- data/lib/active_support/json/encoding.rb +25 -7
- data/lib/active_support/lazy_load_hooks.rb +1 -1
- data/lib/active_support/logger_thread_safe_level.rb +6 -3
- 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 +9 -0
- data/lib/active_support/message_verifiers.rb +5 -3
- data/lib/active_support/messages/rotator.rb +5 -0
- data/lib/active_support/multibyte/chars.rb +4 -1
- data/lib/active_support/notifications/fanout.rb +0 -1
- data/lib/active_support/notifications/instrumenter.rb +1 -1
- data/lib/active_support/number_helper/number_converter.rb +1 -1
- data/lib/active_support/number_helper/number_to_delimited_converter.rb +17 -2
- data/lib/active_support/number_helper.rb +22 -0
- data/lib/active_support/railtie.rb +6 -0
- data/lib/active_support/tagged_logging.rb +5 -0
- data/lib/active_support/test_case.rb +6 -0
- data/lib/active_support/testing/assertions.rb +84 -21
- data/lib/active_support/testing/autorun.rb +5 -0
- data/lib/active_support/testing/isolation.rb +0 -2
- data/lib/active_support/testing/parallelization/server.rb +15 -2
- data/lib/active_support/testing/parallelization/worker.rb +7 -3
- data/lib/active_support/testing/parallelization.rb +12 -1
- 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 +11 -9
- data/lib/active_support/xml_mini.rb +2 -0
- data/lib/active_support.rb +10 -3
- metadata +24 -12
- data/lib/active_support/proxy_object.rb +0 -20
- data/lib/active_support/testing/strict_warnings.rb +0 -43
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e4952a5142700edad7b5bf62c0753a93f202873d96a6ad7dd5b231348ec9d917
|
|
4
|
+
data.tar.gz: 7f832339286eeeec1fda1097ee5ad50b6efc3ae44bb1aa483524907dcb3aebd7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5b4825cf61610686c03d69e648665d4d886e1c755a0f3bc4db14d1bb81331e0c11a79d3c96295185972cb0852e894d66bdc03d2c6787e8c6f3629f4d18e8ce43
|
|
7
|
+
data.tar.gz: 5b7ee77d3c6a4f36a7746d2ce9a2d49d2cc18c9a4e17931626d3dc87c09edb12236180a6ef5d1c7dddcbf7cdafed9d97edb9b9146ed0d56231b286573f41795b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,284 +1,410 @@
|
|
|
1
|
-
## Rails
|
|
1
|
+
## Rails 8.0.5 (March 24, 2026) ##
|
|
2
2
|
|
|
3
|
-
*
|
|
3
|
+
* Fix inflections to better handle overlapping acronyms.
|
|
4
4
|
|
|
5
|
+
```ruby
|
|
6
|
+
ActiveSupport::Inflector.inflections(:en) do |inflect|
|
|
7
|
+
inflect.acronym "USD"
|
|
8
|
+
inflect.acronym "USDC"
|
|
9
|
+
end
|
|
5
10
|
|
|
6
|
-
|
|
11
|
+
"USDC".underscore # => "usdc"
|
|
12
|
+
```
|
|
7
13
|
|
|
8
|
-
*
|
|
14
|
+
*Said Kaldybaev*
|
|
9
15
|
|
|
10
|
-
|
|
16
|
+
* Silence Dalli 4.0+ warning when using `ActiveSupport::Cache::MemCacheStore`.
|
|
11
17
|
|
|
12
|
-
*
|
|
18
|
+
*zzak*
|
|
13
19
|
|
|
14
|
-
|
|
20
|
+
* Make `delegate` and `delegate_missing_to` work in BasicObject subclasses.
|
|
15
21
|
|
|
22
|
+
*Rafael Mendonça França*
|
|
16
23
|
|
|
17
|
-
|
|
24
|
+
* Fix `ActiveSupport::Inflector.humanize` with international characters.
|
|
18
25
|
|
|
19
|
-
|
|
26
|
+
```ruby
|
|
27
|
+
ActiveSupport::Inflector.humanize("áÉÍÓÚ") # => "Áéíóú"
|
|
28
|
+
ActiveSupport::Inflector.humanize("аБВГДЕ") # => "Абвгде"
|
|
29
|
+
```
|
|
20
30
|
|
|
31
|
+
*Jose Luis Duran*
|
|
21
32
|
|
|
22
|
-
## Rails 7.2.1.1 (October 15, 2024) ##
|
|
23
33
|
|
|
24
|
-
|
|
34
|
+
## Rails 8.0.4.1 (March 23, 2026) ##
|
|
25
35
|
|
|
36
|
+
* Reject scientific notation in NumberConverter
|
|
26
37
|
|
|
27
|
-
|
|
38
|
+
[CVE-2026-33176]
|
|
28
39
|
|
|
29
|
-
*
|
|
40
|
+
*Jean Boussier*
|
|
30
41
|
|
|
42
|
+
* Fix `SafeBuffer#%` to preserve unsafe status
|
|
31
43
|
|
|
32
|
-
|
|
44
|
+
[CVE-2026-33170]
|
|
33
45
|
|
|
34
|
-
*
|
|
46
|
+
*Jean Boussier*
|
|
35
47
|
|
|
36
|
-
|
|
37
|
-
class Person
|
|
38
|
-
delegate_missing_to :address, allow_nil: true
|
|
48
|
+
* Improve performance of NumberToDelimitedConverter
|
|
39
49
|
|
|
40
|
-
|
|
41
|
-
nil
|
|
42
|
-
end
|
|
50
|
+
[CVE-2026-33169]
|
|
43
51
|
|
|
44
|
-
|
|
45
|
-
city == "Berlin"
|
|
46
|
-
end
|
|
47
|
-
end
|
|
52
|
+
*Jean Boussier*
|
|
48
53
|
|
|
49
|
-
Person.new.city # => nil
|
|
50
|
-
Person.new.berliner? # undefined local variable or method `city' for an instance of Person (NameError)
|
|
51
|
-
```
|
|
52
54
|
|
|
53
|
-
|
|
55
|
+
## Rails 8.0.4 (October 28, 2025) ##
|
|
54
56
|
|
|
55
|
-
*
|
|
57
|
+
* Fix `Enumerable#sole` to return the full tuple instead of just the first element of the tuple.
|
|
56
58
|
|
|
57
|
-
*
|
|
59
|
+
*Olivier Bellone*
|
|
58
60
|
|
|
59
|
-
*
|
|
61
|
+
* Fix parallel tests hanging when worker processes die abruptly.
|
|
60
62
|
|
|
61
|
-
|
|
63
|
+
Previously, if a worker process was killed (e.g., OOM killed, `kill -9`) during parallel
|
|
64
|
+
test execution, the test suite would hang forever waiting for the dead worker.
|
|
62
65
|
|
|
63
|
-
*
|
|
66
|
+
*Joshua Young*
|
|
64
67
|
|
|
65
|
-
|
|
68
|
+
* Fix `NameError` when `class_attribute` is defined on instance singleton classes.
|
|
66
69
|
|
|
67
|
-
|
|
70
|
+
Previously, calling `class_attribute` on an instance's singleton class would raise
|
|
71
|
+
a `NameError` when accessing the attribute through the instance.
|
|
68
72
|
|
|
69
|
-
|
|
73
|
+
```ruby
|
|
74
|
+
object = MyClass.new
|
|
75
|
+
object.singleton_class.class_attribute :foo, default: "bar"
|
|
76
|
+
object.foo # previously raised NameError, now returns "bar"
|
|
77
|
+
```
|
|
70
78
|
|
|
71
|
-
*
|
|
79
|
+
*Joshua Young*
|
|
72
80
|
|
|
73
|
-
- `deprecate`
|
|
74
|
-
- `deprecate_constant`
|
|
75
|
-
- `ActiveSupport::Deprecation::DeprecatedObjectProxy.new`
|
|
76
|
-
- `ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.new`
|
|
77
|
-
- `ActiveSupport::Deprecation::DeprecatedConstantProxy.new`
|
|
78
|
-
- `assert_deprecated`
|
|
79
|
-
- `assert_not_deprecated`
|
|
80
|
-
- `collect_deprecations`
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
## Rails 8.0.3 (September 22, 2025) ##
|
|
83
83
|
|
|
84
|
-
*
|
|
84
|
+
* `ActiveSupport::FileUpdateChecker` does not depend on `Time.now` to prevent unnecessary reloads with time travel test helpers
|
|
85
85
|
|
|
86
|
-
*
|
|
86
|
+
*Jan Grodowski*
|
|
87
87
|
|
|
88
|
-
*
|
|
88
|
+
* Fix `ActiveSupport::BroadcastLogger` from executing a block argument for each logger (tagged, info, etc.).
|
|
89
89
|
|
|
90
|
-
*
|
|
90
|
+
*Jared Armstrong*
|
|
91
91
|
|
|
92
|
-
*
|
|
92
|
+
* Make `ActiveSupport::Logger` `#freeze`-friendly.
|
|
93
93
|
|
|
94
|
-
*
|
|
94
|
+
*Joshua Young*
|
|
95
95
|
|
|
96
|
-
*
|
|
96
|
+
* Fix `ActiveSupport::HashWithIndifferentAccess#transform_keys!` removing defaults.
|
|
97
97
|
|
|
98
|
-
*
|
|
98
|
+
*Hartley McGuire*
|
|
99
99
|
|
|
100
|
-
*
|
|
100
|
+
* Fix `ActiveSupport::HashWithIndifferentAccess#tranform_keys!` to handle collisions.
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
If the transformation would result in a key equal to another not yet transformed one,
|
|
103
|
+
it would result in keys being lost.
|
|
103
104
|
|
|
104
|
-
|
|
105
|
+
Before:
|
|
105
106
|
|
|
106
|
-
|
|
107
|
+
```ruby
|
|
108
|
+
>> {a: 1, b: 2}.with_indifferent_access.transform_keys!(&:succ)
|
|
109
|
+
=> {"c" => 1}
|
|
110
|
+
```
|
|
107
111
|
|
|
108
|
-
|
|
112
|
+
After:
|
|
109
113
|
|
|
110
|
-
|
|
114
|
+
```ruby
|
|
115
|
+
>> {a: 1, b: 2}.with_indifferent_access.transform_keys!(&:succ)
|
|
116
|
+
=> {"b" => 1, "c" => 2}
|
|
117
|
+
```
|
|
111
118
|
|
|
112
|
-
*
|
|
119
|
+
*Jason T Johnson*, *Jean Boussier*
|
|
113
120
|
|
|
114
|
-
|
|
121
|
+
**Note on overwrite precedence:**
|
|
115
122
|
|
|
116
|
-
|
|
123
|
+
This fix also changed the overwrite precedence when distinct keys are transformed into the same key.
|
|
124
|
+
The later key now overwrites the earlier one (matching standard Ruby `Hash` behavior).
|
|
125
|
+
Previously, the earlier key's value was preserved.
|
|
117
126
|
|
|
118
|
-
|
|
127
|
+
Before:
|
|
119
128
|
|
|
120
|
-
|
|
129
|
+
```ruby
|
|
130
|
+
>> {XY: 1, xy: 2}.with_indifferent_access.transform_keys!(&:downcase)
|
|
131
|
+
=> {"xy"=>1}
|
|
132
|
+
```
|
|
121
133
|
|
|
122
|
-
|
|
134
|
+
After:
|
|
123
135
|
|
|
124
|
-
|
|
136
|
+
```ruby
|
|
137
|
+
>> {XY: 1, xy: 2}.with_indifferent_access.transform_keys!(&:downcase)
|
|
138
|
+
=> {"xy"=>2}
|
|
139
|
+
```
|
|
125
140
|
|
|
126
|
-
|
|
141
|
+
* Fix `ActiveSupport::Cache::MemCacheStore#read_multi` to handle network errors.
|
|
127
142
|
|
|
128
|
-
|
|
143
|
+
This method specifically wasn't handling network errors like other codepaths.
|
|
129
144
|
|
|
130
|
-
|
|
131
|
-
|
|
145
|
+
*Alessandro Dal Grande*
|
|
146
|
+
|
|
147
|
+
* Fix configuring `RedisCacheStore` with `raw: true`.
|
|
132
148
|
|
|
133
149
|
*fatkodima*
|
|
134
150
|
|
|
135
|
-
*
|
|
151
|
+
* Fix `Enumerable#sole` for infinite collections.
|
|
152
|
+
|
|
153
|
+
*fatkodima*
|
|
136
154
|
|
|
137
|
-
*heka1024*
|
|
138
155
|
|
|
139
|
-
|
|
156
|
+
## Rails 8.0.2.1 (August 13, 2025) ##
|
|
140
157
|
|
|
141
|
-
|
|
158
|
+
* No changes.
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
## Rails 8.0.2 (March 12, 2025) ##
|
|
142
162
|
|
|
143
|
-
*
|
|
163
|
+
* Fix setting `to_time_preserves_timezone` from `new_framework_defaults_8_0.rb`.
|
|
164
|
+
|
|
165
|
+
*fatkodima*
|
|
166
|
+
|
|
167
|
+
* Fix Active Support Cache `fetch_multi` when local store is active.
|
|
168
|
+
|
|
169
|
+
`fetch_multi` now properly yield to the provided block for missing entries
|
|
170
|
+
that have been recorded as such in the local store.
|
|
144
171
|
|
|
145
172
|
*Jean Boussier*
|
|
146
173
|
|
|
147
|
-
*
|
|
174
|
+
* Fix execution wrapping to report all exceptions, including `Exception`.
|
|
175
|
+
|
|
176
|
+
If a more serious error like `SystemStackError` or `NoMemoryError` happens,
|
|
177
|
+
the error reporter should be able to report these kinds of exceptions.
|
|
178
|
+
|
|
179
|
+
*Gannon McGibbon*
|
|
148
180
|
|
|
149
|
-
|
|
150
|
-
|
|
181
|
+
* Fix `RedisCacheStore` and `MemCacheStore` to also handle connection pool related errors.
|
|
182
|
+
|
|
183
|
+
These errors are rescued and reported to `Rails.error`.
|
|
151
184
|
|
|
152
185
|
*Jean Boussier*
|
|
153
186
|
|
|
154
|
-
*
|
|
187
|
+
* Fix `ActiveSupport::Cache#read_multi` to respect version expiry when using local cache.
|
|
155
188
|
|
|
156
|
-
*
|
|
189
|
+
*zzak*
|
|
157
190
|
|
|
158
|
-
*
|
|
191
|
+
* Fix `ActiveSupport::MessageVerifier` and `ActiveSupport::MessageEncryptor` configuration of `on_rotation` callback.
|
|
159
192
|
|
|
160
193
|
```ruby
|
|
161
|
-
|
|
162
|
-
ActiveSupport::Logger.logger_outputs_to?(logger, '/var/log/rails.log')
|
|
194
|
+
verifier.rotate(old_secret).on_rotation { ... }
|
|
163
195
|
```
|
|
164
196
|
|
|
165
|
-
|
|
197
|
+
Now both work as documented.
|
|
198
|
+
|
|
199
|
+
*Jean Boussier*
|
|
166
200
|
|
|
167
|
-
*
|
|
168
|
-
`ActiveSupport::MessagePack` serializer.
|
|
201
|
+
* Fix `ActiveSupport::MessageVerifier` to always be able to verify both URL-safe and URL-unsafe payloads.
|
|
169
202
|
|
|
170
|
-
This
|
|
171
|
-
|
|
203
|
+
This is to allow transitioning seemlessly from either configuration without immediately invalidating
|
|
204
|
+
all previously generated signed messages.
|
|
172
205
|
|
|
173
|
-
*
|
|
206
|
+
*Jean Boussier*, *Florent Beaurain*, *Ali Sepehri*
|
|
174
207
|
|
|
175
|
-
*
|
|
208
|
+
* Fix `cache.fetch` to honor the provided expiry when `:race_condition_ttl` is used.
|
|
176
209
|
|
|
177
210
|
```ruby
|
|
178
|
-
|
|
179
|
-
|
|
211
|
+
cache.fetch("key", expires_in: 1.hour, race_condition_ttl: 5.second) do
|
|
212
|
+
"something"
|
|
180
213
|
end
|
|
181
214
|
```
|
|
182
215
|
|
|
183
|
-
|
|
216
|
+
In the above example, the final cache entry would have a 10 seconds TTL instead
|
|
217
|
+
of the requested 1 hour.
|
|
218
|
+
|
|
219
|
+
*Dhia*
|
|
184
220
|
|
|
185
|
-
*
|
|
221
|
+
* Better handle procs with splat arguments in `set_callback`.
|
|
222
|
+
|
|
223
|
+
*Radamés Roriz*
|
|
224
|
+
|
|
225
|
+
* Fix `String#mb_chars` to not mutate the receiver.
|
|
226
|
+
|
|
227
|
+
Previously it would call `force_encoding` on the receiver,
|
|
228
|
+
now it dups the receiver first.
|
|
229
|
+
|
|
230
|
+
*Jean Boussier*
|
|
231
|
+
|
|
232
|
+
* Improve `ErrorSubscriber` to also mark error causes as reported.
|
|
233
|
+
|
|
234
|
+
This avoid some cases of errors being reported twice, notably in views because of how
|
|
235
|
+
errors are wrapped in `ActionView::Template::Error`.
|
|
236
|
+
|
|
237
|
+
*Jean Boussier*
|
|
238
|
+
|
|
239
|
+
* Fix `Module#module_parent_name` to return the correct name after the module has been named.
|
|
240
|
+
|
|
241
|
+
When called on an anonymous module, the return value wouldn't change after the module was given a name
|
|
242
|
+
later by being assigned to a constant.
|
|
186
243
|
|
|
187
244
|
```ruby
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
245
|
+
mod = Module.new
|
|
246
|
+
mod.module_parent_name # => "Object"
|
|
247
|
+
MyModule::Something = mod
|
|
248
|
+
mod.module_parent_name # => "MyModule"
|
|
191
249
|
```
|
|
192
250
|
|
|
193
|
-
*
|
|
251
|
+
*Jean Boussier*
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
## Rails 8.0.1 (December 13, 2024) ##
|
|
255
|
+
|
|
256
|
+
* Fix a bug in `ERB::Util.tokenize` that causes incorrect tokenization when ERB tags are preceeded by multibyte characters.
|
|
257
|
+
|
|
258
|
+
*Martin Emde*
|
|
259
|
+
|
|
260
|
+
* Restore the ability to decorate methods generated by `class_attribute`.
|
|
261
|
+
|
|
262
|
+
It always has been complicated to use Module#prepend or an alias method chain
|
|
263
|
+
to decorate methods defined by `class_attribute`, but became even harder in 8.0.
|
|
264
|
+
|
|
265
|
+
This capability is now supported for both reader and writer methods.
|
|
266
|
+
|
|
267
|
+
*Jean Boussier*
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
## Rails 8.0.0.1 (December 10, 2024) ##
|
|
271
|
+
|
|
272
|
+
* No changes.
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
## Rails 8.0.0 (November 07, 2024) ##
|
|
276
|
+
|
|
277
|
+
* No changes.
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
## Rails 8.0.0.rc2 (October 30, 2024) ##
|
|
281
|
+
|
|
282
|
+
* No changes.
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
## Rails 8.0.0.rc1 (October 19, 2024) ##
|
|
286
|
+
|
|
287
|
+
* Remove deprecated support to passing an array of strings to `ActiveSupport::Deprecation#warn`.
|
|
288
|
+
|
|
289
|
+
*Rafael Mendonça França*
|
|
194
290
|
|
|
195
|
-
*
|
|
196
|
-
default number of workers when parallelizing tests.
|
|
291
|
+
* Remove deprecated support to setting `attr_internal_naming_format` with a `@` prefix.
|
|
197
292
|
|
|
198
|
-
*
|
|
293
|
+
*Rafael Mendonça França*
|
|
199
294
|
|
|
200
|
-
*
|
|
295
|
+
* Remove deprecated `ActiveSupport::ProxyObject`.
|
|
201
296
|
|
|
202
|
-
|
|
203
|
-
it remembers a timezone of its argument, and all stubbed methods start
|
|
204
|
-
returning results in that remembered timezone. However, the expected
|
|
205
|
-
behavior is to return results in a system timezone.
|
|
297
|
+
*Rafael Mendonça França*
|
|
206
298
|
|
|
207
|
-
|
|
299
|
+
* Don't execute i18n watcher on boot. It shouldn't catch any file changes initially,
|
|
300
|
+
and unnecessarily slows down boot of applications with lots of translations.
|
|
208
301
|
|
|
209
|
-
*
|
|
302
|
+
*Gannon McGibbon*, *David Stosik*
|
|
210
303
|
|
|
211
|
-
|
|
304
|
+
* Fix `ActiveSupport::HashWithIndifferentAccess#stringify_keys` to stringify all keys not just symbols.
|
|
305
|
+
|
|
306
|
+
Previously:
|
|
212
307
|
|
|
213
308
|
```ruby
|
|
214
|
-
|
|
215
|
-
if published?
|
|
216
|
-
Rails.error.unexpected("[BUG] Attempting to edit a published article, that shouldn't be possible")
|
|
217
|
-
return false
|
|
218
|
-
end
|
|
219
|
-
# ...
|
|
220
|
-
end
|
|
309
|
+
{ 1 => 2 }.with_indifferent_access.stringify_keys[1] # => 2
|
|
221
310
|
```
|
|
222
311
|
|
|
223
|
-
|
|
312
|
+
After this change:
|
|
313
|
+
|
|
314
|
+
```ruby
|
|
315
|
+
{ 1 => 2 }.with_indifferent_access.stringify_keys["1"] # => 2
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
This change can be seen as a bug fix, but since it behaved like this for a very long time, we're deciding
|
|
319
|
+
to not backport the fix and to make the change in a major release.
|
|
224
320
|
|
|
225
321
|
*Jean Boussier*
|
|
226
322
|
|
|
227
|
-
|
|
323
|
+
## Rails 8.0.0.beta1 (September 26, 2024) ##
|
|
324
|
+
|
|
325
|
+
* Include options when instrumenting `ActiveSupport::Cache::Store#delete` and `ActiveSupport::Cache::Store#delete_multi`.
|
|
228
326
|
|
|
229
327
|
*Adam Renberg Tamm*
|
|
230
328
|
|
|
231
|
-
*
|
|
329
|
+
* Print test names when running `rails test -v` for parallel tests.
|
|
232
330
|
|
|
233
|
-
|
|
234
|
-
`nil` if there was an error talking to the cache backend, and `false` if the write failed
|
|
235
|
-
for another reason (e.g. the key already exists and `unless_exist: true` was passed).
|
|
331
|
+
*John Hawthorn*, *Abeid Ahmed*
|
|
236
332
|
|
|
237
|
-
|
|
333
|
+
* Deprecate `Benchmark.ms` core extension.
|
|
238
334
|
|
|
239
|
-
|
|
335
|
+
The `benchmark` gem will become bundled in Ruby 3.5
|
|
240
336
|
|
|
241
|
-
*
|
|
337
|
+
*Earlopain*
|
|
242
338
|
|
|
243
|
-
*
|
|
339
|
+
* `ActiveSupport::TimeWithZone#inspect` now uses ISO 8601 style time like `Time#inspect`
|
|
244
340
|
|
|
245
|
-
|
|
246
|
-
to differentiate nil from empty strings, strings from symbols, etc.
|
|
247
|
-
`assert_no_changes` error messages now surface the actual value.
|
|
341
|
+
*John Hawthorn*
|
|
248
342
|
|
|
249
|
-
|
|
343
|
+
* `ActiveSupport::ErrorReporter#report` now assigns a backtrace to unraised exceptions.
|
|
250
344
|
|
|
251
|
-
|
|
345
|
+
Previously reporting an un-raised exception would result in an error report without
|
|
346
|
+
a backtrace. Now it automatically generates one.
|
|
252
347
|
|
|
253
|
-
*
|
|
348
|
+
*Jean Boussier*
|
|
254
349
|
|
|
255
|
-
*
|
|
350
|
+
* Add `escape_html_entities` option to `ActiveSupport::JSON.encode`.
|
|
256
351
|
|
|
257
|
-
|
|
352
|
+
This allows for overriding the global configuration found at
|
|
353
|
+
`ActiveSupport.escape_html_entities_in_json` for specific calls to `to_json`.
|
|
258
354
|
|
|
259
|
-
|
|
355
|
+
This should be usable from controllers in the following manner:
|
|
356
|
+
```ruby
|
|
357
|
+
class MyController < ApplicationController
|
|
358
|
+
def index
|
|
359
|
+
render json: { hello: "world" }, escape_html_entities: false
|
|
360
|
+
end
|
|
361
|
+
end
|
|
362
|
+
```
|
|
260
363
|
|
|
261
|
-
*
|
|
364
|
+
*Nigel Baillie*
|
|
262
365
|
|
|
263
|
-
*
|
|
366
|
+
* Raise when using key which can't respond to `#to_sym` in `EncryptedConfiguration`.
|
|
264
367
|
|
|
265
|
-
|
|
266
|
-
`SemanticLogger#level` returns a Symbol while stdlib `Logger#level` returns an Integer.
|
|
368
|
+
As is the case when trying to use an Integer or Float as a key, which is unsupported.
|
|
267
369
|
|
|
268
|
-
|
|
269
|
-
`SemanticLogger` instance.
|
|
370
|
+
*zzak*
|
|
270
371
|
|
|
271
|
-
|
|
372
|
+
* Deprecate addition and since between two `Time` and `ActiveSupport::TimeWithZone`.
|
|
272
373
|
|
|
273
|
-
|
|
374
|
+
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.
|
|
274
375
|
|
|
275
|
-
*
|
|
376
|
+
*Nick Schwaderer*
|
|
276
377
|
|
|
277
|
-
*
|
|
378
|
+
* Support rfc2822 format for Time#to_fs & Date#to_fs.
|
|
278
379
|
|
|
279
|
-
|
|
280
|
-
method from the `Hash` class, which was not able to access values using indifferent keys.
|
|
380
|
+
*Akshay Birajdar*
|
|
281
381
|
|
|
282
|
-
|
|
382
|
+
* Optimize load time for `Railtie#initialize_i18n`. Filter `I18n.load_path`s passed to the file watcher to only those
|
|
383
|
+
under `Rails.root`. Previously the watcher would grab all available locales, including those in gems
|
|
384
|
+
which do not require a watcher because they won't change.
|
|
385
|
+
|
|
386
|
+
*Nick Schwaderer*
|
|
387
|
+
|
|
388
|
+
* Add a `filter` option to `in_order_of` to prioritize certain values in the sorting without filtering the results
|
|
389
|
+
by these values.
|
|
390
|
+
|
|
391
|
+
*Igor Depolli*
|
|
392
|
+
|
|
393
|
+
* Improve error message when using `assert_difference` or `assert_changes` with a
|
|
394
|
+
proc by printing the proc's source code (MRI only).
|
|
395
|
+
|
|
396
|
+
*Richard Böhme*, *Jean Boussier*
|
|
397
|
+
|
|
398
|
+
* 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`.
|
|
399
|
+
|
|
400
|
+
*Jason Kim*, *John Hawthorn*
|
|
401
|
+
|
|
402
|
+
* Align instrumentation `payload[:key]` in ActiveSupport::Cache to follow the same pattern, with namespaced and normalized keys.
|
|
403
|
+
|
|
404
|
+
*Frederik Erbs Spang Thomsen*
|
|
405
|
+
|
|
406
|
+
* Fix `travel_to` to set usec 0 when `with_usec` is `false` and the given argument String or DateTime.
|
|
407
|
+
|
|
408
|
+
*mopp*
|
|
283
409
|
|
|
284
|
-
Please check [7-
|
|
410
|
+
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 rubyonrails-core forum 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.delete_prefix(root) }
|
|
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
|