activesupport 7.1.5.2 → 7.2.0
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 +110 -1163
- data/lib/active_support/array_inquirer.rb +1 -1
- data/lib/active_support/backtrace_cleaner.rb +10 -3
- data/lib/active_support/broadcast_logger.rb +18 -18
- data/lib/active_support/cache/file_store.rb +15 -10
- data/lib/active_support/cache/mem_cache_store.rb +16 -74
- data/lib/active_support/cache/memory_store.rb +2 -1
- data/lib/active_support/cache/redis_cache_store.rb +16 -13
- data/lib/active_support/cache/serializer_with_fallback.rb +0 -23
- data/lib/active_support/cache.rb +59 -67
- data/lib/active_support/callbacks.rb +74 -113
- data/lib/active_support/core_ext/array/conversions.rb +0 -2
- data/lib/active_support/core_ext/class/subclasses.rb +15 -35
- data/lib/active_support/core_ext/date/blank.rb +4 -0
- data/lib/active_support/core_ext/date/conversions.rb +0 -2
- data/lib/active_support/core_ext/date_and_time/compatibility.rb +28 -1
- data/lib/active_support/core_ext/date_time/blank.rb +4 -0
- data/lib/active_support/core_ext/date_time/conversions.rb +0 -4
- data/lib/active_support/core_ext/digest/uuid.rb +6 -0
- data/lib/active_support/core_ext/erb/util.rb +5 -0
- data/lib/active_support/core_ext/hash/keys.rb +4 -4
- data/lib/active_support/core_ext/module/attr_internal.rb +17 -6
- data/lib/active_support/core_ext/module/delegation.rb +20 -163
- data/lib/active_support/core_ext/module/deprecation.rb +1 -4
- data/lib/active_support/core_ext/numeric/conversions.rb +3 -3
- data/lib/active_support/core_ext/object/blank.rb +45 -1
- data/lib/active_support/core_ext/object/instance_variables.rb +11 -19
- data/lib/active_support/core_ext/object/json.rb +4 -6
- data/lib/active_support/core_ext/object/with.rb +5 -3
- data/lib/active_support/core_ext/pathname/blank.rb +4 -0
- data/lib/active_support/core_ext/range/overlap.rb +1 -1
- data/lib/active_support/core_ext/securerandom.rb +8 -24
- data/lib/active_support/core_ext/string/conversions.rb +1 -1
- data/lib/active_support/core_ext/string/filters.rb +1 -1
- data/lib/active_support/core_ext/string/output_safety.rb +0 -7
- data/lib/active_support/core_ext/time/calculations.rb +18 -28
- data/lib/active_support/core_ext/time/compatibility.rb +16 -0
- data/lib/active_support/core_ext/time/conversions.rb +0 -2
- data/lib/active_support/core_ext.rb +0 -1
- data/lib/active_support/current_attributes.rb +33 -40
- data/lib/active_support/delegation.rb +202 -0
- data/lib/active_support/dependencies/autoload.rb +0 -12
- data/lib/active_support/deprecation/constant_accessor.rb +47 -26
- data/lib/active_support/deprecation/proxy_wrappers.rb +9 -12
- data/lib/active_support/deprecation/reporting.rb +9 -4
- data/lib/active_support/deprecation.rb +8 -5
- data/lib/active_support/descendants_tracker.rb +9 -87
- data/lib/active_support/duration/iso8601_parser.rb +2 -2
- data/lib/active_support/duration/iso8601_serializer.rb +1 -2
- data/lib/active_support/duration.rb +11 -6
- data/lib/active_support/error_reporter.rb +41 -3
- data/lib/active_support/evented_file_update_checker.rb +0 -1
- data/lib/active_support/execution_wrapper.rb +0 -1
- data/lib/active_support/file_update_checker.rb +1 -1
- data/lib/active_support/fork_tracker.rb +2 -38
- data/lib/active_support/gem_version.rb +3 -3
- data/lib/active_support/hash_with_indifferent_access.rb +6 -8
- data/lib/active_support/html_safe_translation.rb +3 -0
- data/lib/active_support/log_subscriber.rb +0 -12
- data/lib/active_support/logger.rb +15 -2
- data/lib/active_support/logger_thread_safe_level.rb +0 -8
- data/lib/active_support/message_pack/extensions.rb +15 -2
- data/lib/active_support/message_verifier.rb +12 -0
- data/lib/active_support/multibyte/chars.rb +2 -2
- data/lib/active_support/notifications/fanout.rb +4 -7
- data/lib/active_support/notifications/instrumenter.rb +21 -18
- data/lib/active_support/notifications.rb +28 -27
- data/lib/active_support/number_helper/number_converter.rb +2 -2
- data/lib/active_support/option_merger.rb +2 -2
- data/lib/active_support/ordered_options.rb +53 -15
- data/lib/active_support/proxy_object.rb +8 -5
- data/lib/active_support/railtie.rb +4 -11
- data/lib/active_support/string_inquirer.rb +1 -1
- data/lib/active_support/tagged_logging.rb +0 -1
- data/lib/active_support/test_case.rb +3 -1
- data/lib/active_support/testing/assertions.rb +4 -4
- data/lib/active_support/testing/constant_stubbing.rb +30 -8
- data/lib/active_support/testing/deprecation.rb +5 -12
- data/lib/active_support/testing/isolation.rb +18 -8
- data/lib/active_support/testing/method_call_assertions.rb +2 -16
- data/lib/active_support/testing/strict_warnings.rb +5 -4
- data/lib/active_support/testing/tests_without_assertions.rb +19 -0
- data/lib/active_support/testing/time_helpers.rb +3 -3
- data/lib/active_support/time_with_zone.rb +7 -3
- data/lib/active_support/values/time_zone.rb +1 -1
- data/lib/active_support/xml_mini.rb +11 -2
- data/lib/active_support.rb +2 -1
- metadata +20 -39
- data/lib/active_support/deprecation/instance_delegator.rb +0 -65
- data/lib/active_support/ruby_features.rb +0 -7
data/CHANGELOG.md
CHANGED
|
@@ -1,49 +1,4 @@
|
|
|
1
|
-
## Rails 7.
|
|
2
|
-
|
|
3
|
-
* No changes.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
## Rails 7.1.5.1 (December 10, 2024) ##
|
|
7
|
-
|
|
8
|
-
* No changes.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
## Rails 7.1.5 (October 30, 2024) ##
|
|
12
|
-
|
|
13
|
-
* No changes.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
## Rails 7.1.4.2 (October 23, 2024) ##
|
|
17
|
-
|
|
18
|
-
* No changes.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
## Rails 7.1.4.1 (October 15, 2024) ##
|
|
22
|
-
|
|
23
|
-
* No changes.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
## Rails 7.1.4 (August 22, 2024) ##
|
|
27
|
-
|
|
28
|
-
* Improve compatibility for `ActiveSupport::BroadcastLogger`.
|
|
29
|
-
|
|
30
|
-
*Máximo Mussini*
|
|
31
|
-
|
|
32
|
-
* Pass options along to write_entry in handle_expired_entry method.
|
|
33
|
-
|
|
34
|
-
*Graham Cooper*
|
|
35
|
-
|
|
36
|
-
* Fix Active Support configurations deprecations.
|
|
37
|
-
|
|
38
|
-
*fatkodima*
|
|
39
|
-
|
|
40
|
-
* Fix teardown callbacks.
|
|
41
|
-
|
|
42
|
-
*Tristan Starck*
|
|
43
|
-
|
|
44
|
-
* `BacktraceCleaner` silence core internal methods by default.
|
|
45
|
-
|
|
46
|
-
*Jean Boussier*
|
|
1
|
+
## Rails 7.2.0 (August 09, 2024) ##
|
|
47
2
|
|
|
48
3
|
* Fix `delegate_missing_to allow_nil: true` when called with implict self
|
|
49
4
|
|
|
@@ -66,1241 +21,233 @@
|
|
|
66
21
|
|
|
67
22
|
*Jean Boussier*
|
|
68
23
|
|
|
69
|
-
*
|
|
70
|
-
|
|
71
|
-
This would happen if using `TaggerLogger` with a Proc
|
|
72
|
-
formatter on which you called `object_id`.
|
|
73
|
-
|
|
74
|
-
```
|
|
75
|
-
[BUG] Object ID seen, but not in mapping table: proc
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
*Jean Boussier*
|
|
79
|
-
|
|
80
|
-
* Fix `ActiveSupport::Notifications.publish_event` to preserve units.
|
|
81
|
-
|
|
82
|
-
This solves the incorrect reporting of time spent running Active Record
|
|
83
|
-
asynchronous queries (by a factor `1000`).
|
|
84
|
-
|
|
85
|
-
*Jean Boussier*
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
## Rails 7.1.3.4 (June 04, 2024) ##
|
|
89
|
-
|
|
90
|
-
* No changes.
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
## Rails 7.1.3.3 (May 16, 2024) ##
|
|
94
|
-
|
|
95
|
-
* No changes.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
## Rails 7.1.3.2 (February 21, 2024) ##
|
|
99
|
-
|
|
100
|
-
* No changes.
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
## Rails 7.1.3.1 (February 21, 2024) ##
|
|
104
|
-
|
|
105
|
-
* No changes.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
## Rails 7.1.3 (January 16, 2024) ##
|
|
109
|
-
|
|
110
|
-
* Handle nil `backtrace_locations` in `ActiveSupport::SyntaxErrorProxy`.
|
|
111
|
-
|
|
112
|
-
*Eugene Kenny*
|
|
113
|
-
|
|
114
|
-
* Fix `ActiveSupport::JSON.encode` to prevent duplicate keys.
|
|
115
|
-
|
|
116
|
-
If the same key exist in both String and Symbol form it could
|
|
117
|
-
lead to the same key being emitted twice.
|
|
118
|
-
|
|
119
|
-
*Manish Sharma*
|
|
120
|
-
|
|
121
|
-
* Fix `ActiveSupport::Cache::Store#read_multi` when using a cache namespace
|
|
122
|
-
and local cache strategy.
|
|
123
|
-
|
|
124
|
-
*Mark Oleson*
|
|
125
|
-
|
|
126
|
-
* Fix `Time.now/DateTime.now/Date.today` to return results in a system timezone after `#travel_to`.
|
|
127
|
-
|
|
128
|
-
There is a bug in the current implementation of #travel_to:
|
|
129
|
-
it remembers a timezone of its argument, and all stubbed methods start
|
|
130
|
-
returning results in that remembered timezone. However, the expected
|
|
131
|
-
behaviour is to return results in a system timezone.
|
|
132
|
-
|
|
133
|
-
*Aleksei Chernenkov*
|
|
134
|
-
|
|
135
|
-
* Fix `:unless_exist` option for `MemoryStore#write` (et al) when using a
|
|
136
|
-
cache namespace.
|
|
137
|
-
|
|
138
|
-
*S. Brent Faulkner*
|
|
139
|
-
|
|
140
|
-
* Fix ActiveSupport::Deprecation to handle blaming generated code.
|
|
141
|
-
|
|
142
|
-
*Jean Boussier*, *fatkodima*
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
## Rails 7.1.2 (November 10, 2023) ##
|
|
146
|
-
|
|
147
|
-
* Fix `:expires_in` option for `RedisCacheStore#write_multi`.
|
|
148
|
-
|
|
149
|
-
*fatkodima*
|
|
150
|
-
|
|
151
|
-
* Fix deserialization of non-string "purpose" field in Message serializer
|
|
152
|
-
|
|
153
|
-
*Jacopo Beschi*
|
|
154
|
-
|
|
155
|
-
* Prevent global cache options being overwritten when setting dynamic options
|
|
156
|
-
inside a `ActiveSupport::Cache::Store#fetch` block.
|
|
157
|
-
|
|
158
|
-
*Yasha Krasnou*
|
|
159
|
-
|
|
160
|
-
* Fix missing `require` resulting in `NoMethodError` when running
|
|
161
|
-
`bin/rails secrets:show` or `bin/rails secrets:edit`.
|
|
162
|
-
|
|
163
|
-
*Stephen Ierodiaconou*
|
|
164
|
-
|
|
165
|
-
* Ensure `{down,up}case_first` returns non-frozen string.
|
|
166
|
-
|
|
167
|
-
*Jonathan Hefner*
|
|
168
|
-
|
|
169
|
-
* Fix `#to_fs(:human_size)` to correctly work with negative numbers.
|
|
24
|
+
* Add `logger` as a dependency since it is a bundled gem candidate for Ruby 3.5
|
|
170
25
|
|
|
171
26
|
*Earlopain*
|
|
172
27
|
|
|
173
|
-
*
|
|
174
|
-
|
|
175
|
-
*Andrew Novoselac*
|
|
176
|
-
|
|
177
|
-
* Fix issue where `bootstrap.rb` overwrites the `level` of a `BroadcastLogger`'s `broadcasts`.
|
|
178
|
-
|
|
179
|
-
*Andrew Novoselac*
|
|
180
|
-
|
|
181
|
-
* Fix `ActiveSupport::Cache` to handle outdated Marshal payload from Rails 6.1 format.
|
|
28
|
+
* Define `Digest::UUID.nil_uuid`, which returns the so-called nil UUID.
|
|
182
29
|
|
|
183
|
-
|
|
184
|
-
deserialized as a cache miss. It fail to do so for compressed payload in the Rails 6.1
|
|
185
|
-
legacy format.
|
|
186
|
-
|
|
187
|
-
*Jean Boussier*
|
|
188
|
-
|
|
189
|
-
* Fix `OrderedOptions#dig` for array indexes.
|
|
190
|
-
|
|
191
|
-
*fatkodima*
|
|
192
|
-
|
|
193
|
-
* Fix time travel helpers to work when nested using with separate classes.
|
|
194
|
-
|
|
195
|
-
*fatkodima*
|
|
196
|
-
|
|
197
|
-
* Fix `delete_matched` for file cache store to work with keys longer than the
|
|
198
|
-
max filename size.
|
|
199
|
-
|
|
200
|
-
*fatkodima* and *Jonathan Hefner*
|
|
201
|
-
|
|
202
|
-
* Fix compatibility with the `semantic_logger` gem.
|
|
203
|
-
|
|
204
|
-
The `semantic_logger` gem doesn't behave exactly like stdlib logger in that
|
|
205
|
-
`SemanticLogger#level` returns a Symbol while stdlib `Logger#level` returns an Integer.
|
|
206
|
-
|
|
207
|
-
This caused the various `LogSubscriber` classes in Rails to break when assigned a
|
|
208
|
-
`SemanticLogger` instance.
|
|
209
|
-
|
|
210
|
-
*Jean Boussier*, *ojab*
|
|
211
|
-
|
|
212
|
-
## Rails 7.1.1 (October 11, 2023) ##
|
|
213
|
-
|
|
214
|
-
* Add support for keyword arguments when delegating calls to custom loggers from `ActiveSupport::BroadcastLogger`.
|
|
215
|
-
|
|
216
|
-
*Edouard Chin*
|
|
217
|
-
|
|
218
|
-
* `NumberHelper`: handle objects responding `to_d`.
|
|
219
|
-
|
|
220
|
-
*fatkodima*
|
|
221
|
-
|
|
222
|
-
* Fix RedisCacheStore to properly set the TTL when incrementing or decrementing.
|
|
223
|
-
|
|
224
|
-
This bug was only impacting Redis server older than 7.0.
|
|
225
|
-
|
|
226
|
-
*Thomas Countz*
|
|
227
|
-
|
|
228
|
-
* Fix MemoryStore to prevent race conditions when incrementing or decrementing.
|
|
229
|
-
|
|
230
|
-
*Pierre Jambet*
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
## Rails 7.1.0 (October 05, 2023) ##
|
|
234
|
-
|
|
235
|
-
* No changes.
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
## Rails 7.1.0.rc2 (October 01, 2023) ##
|
|
239
|
-
|
|
240
|
-
* Fix `AS::MessagePack` with `ENV["RAILS_MAX_THREADS"]`.
|
|
241
|
-
|
|
242
|
-
*Jonathan Hefner*
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
## Rails 7.1.0.rc1 (September 27, 2023) ##
|
|
246
|
-
|
|
247
|
-
* Add a new public API for broadcasting logs
|
|
248
|
-
|
|
249
|
-
This feature existed for a while but was until now a private API.
|
|
250
|
-
Broadcasting log allows to send log message to difference sinks (STDOUT, a file ...) and
|
|
251
|
-
is used by default in the development environment to write logs both on STDOUT and in the
|
|
252
|
-
"development.log" file.
|
|
253
|
-
|
|
254
|
-
Basic usage:
|
|
255
|
-
|
|
256
|
-
```ruby
|
|
257
|
-
stdout_logger = Logger.new(STDOUT)
|
|
258
|
-
file_logger = Logger.new("development.log")
|
|
259
|
-
broadcast = ActiveSupport::BroadcastLogger.new(stdout_logger, file_logger)
|
|
260
|
-
|
|
261
|
-
broadcast.info("Hello!") # The "Hello!" message is written on STDOUT and in the log file.
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
Adding other sink(s) to the broadcast:
|
|
265
|
-
|
|
266
|
-
```ruby
|
|
267
|
-
broadcast = ActiveSupport::BroadcastLogger.new
|
|
268
|
-
broadcast.broadcast_to(Logger.new(STDERR))
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
Remove a sink from the broadcast:
|
|
272
|
-
|
|
273
|
-
```ruby
|
|
274
|
-
stdout_logger = Logger.new(STDOUT)
|
|
275
|
-
broadcast = ActiveSupport::BroadcastLogger.new(stdout_logger)
|
|
276
|
-
|
|
277
|
-
broadcast.stop_broadcasting_to(stdout_logger)
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
*Edouard Chin*
|
|
281
|
-
|
|
282
|
-
* Fix Range#overlap? not taking empty ranges into account on Ruby < 3.3
|
|
283
|
-
|
|
284
|
-
*Nobuyoshi Nakada*, *Shouichi Kamiya*, *Hartley McGuire*
|
|
285
|
-
|
|
286
|
-
* Use Ruby 3.3 Range#overlap? if available
|
|
287
|
-
|
|
288
|
-
*Yasuo Honda*
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
## Rails 7.1.0.beta1 (September 13, 2023) ##
|
|
292
|
-
|
|
293
|
-
* Add `bigdecimal` as Active Support dependency that is a bundled gem candidate for Ruby 3.4.
|
|
294
|
-
|
|
295
|
-
`bigdecimal` 3.1.4 or higher version will be installed.
|
|
296
|
-
Ruby 2.7 and 3.0 users who want `bigdecimal` version 2.0.0 or 3.0.0 behavior as a default gem,
|
|
297
|
-
pin the `bigdecimal` version in your application Gemfile.
|
|
298
|
-
|
|
299
|
-
*Koichi ITO*
|
|
300
|
-
|
|
301
|
-
* Add `drb`, `mutex_m` and `base64` that are bundled gem candidates for Ruby 3.4
|
|
302
|
-
|
|
303
|
-
*Yasuo Honda*
|
|
304
|
-
|
|
305
|
-
* When using cache format version >= 7.1 or a custom serializer, expired and
|
|
306
|
-
version-mismatched cache entries can now be detected without deserializing
|
|
307
|
-
their values.
|
|
308
|
-
|
|
309
|
-
*Jonathan Hefner*
|
|
310
|
-
|
|
311
|
-
* Make all cache stores return a boolean for `#delete`
|
|
312
|
-
|
|
313
|
-
Previously the `RedisCacheStore#delete` would return `1` if the entry
|
|
314
|
-
exists and `0` otherwise. Now it returns true if the entry exists and false
|
|
315
|
-
otherwise, just like the other stores.
|
|
316
|
-
|
|
317
|
-
The `FileStore` would return `nil` if the entry doesn't exists and returns
|
|
318
|
-
`false` now as well.
|
|
319
|
-
|
|
320
|
-
*Petrik de Heus*
|
|
321
|
-
|
|
322
|
-
* Active Support cache stores now support replacing the default compressor via
|
|
323
|
-
a `:compressor` option. The specified compressor must respond to `deflate`
|
|
324
|
-
and `inflate`. For example:
|
|
325
|
-
|
|
326
|
-
```ruby
|
|
327
|
-
module MyCompressor
|
|
328
|
-
def self.deflate(string)
|
|
329
|
-
# compression logic...
|
|
330
|
-
end
|
|
331
|
-
|
|
332
|
-
def self.inflate(compressed)
|
|
333
|
-
# decompression logic...
|
|
334
|
-
end
|
|
335
|
-
end
|
|
336
|
-
|
|
337
|
-
config.cache_store = :redis_cache_store, { compressor: MyCompressor }
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
*Jonathan Hefner*
|
|
341
|
-
|
|
342
|
-
* Active Support cache stores now support a `:serializer` option. Similar to
|
|
343
|
-
the `:coder` option, serializers must respond to `dump` and `load`. However,
|
|
344
|
-
serializers are only responsible for serializing a cached value, whereas
|
|
345
|
-
coders are responsible for serializing the entire `ActiveSupport::Cache::Entry`
|
|
346
|
-
instance. Additionally, the output from serializers can be automatically
|
|
347
|
-
compressed, whereas coders are responsible for their own compression.
|
|
348
|
-
|
|
349
|
-
Specifying a serializer instead of a coder also enables performance
|
|
350
|
-
optimizations, including the bare string optimization introduced by cache
|
|
351
|
-
format version 7.1.
|
|
352
|
-
|
|
353
|
-
The `:serializer` and `:coder` options are mutually exclusive. Specifying
|
|
354
|
-
both will raise an `ArgumentError`.
|
|
355
|
-
|
|
356
|
-
*Jonathan Hefner*
|
|
357
|
-
|
|
358
|
-
* Fix `ActiveSupport::Inflector.humanize(nil)` raising ``NoMethodError: undefined method `end_with?' for nil:NilClass``.
|
|
359
|
-
|
|
360
|
-
*James Robinson*
|
|
361
|
-
|
|
362
|
-
* Don't show secrets for `ActiveSupport::KeyGenerator#inspect`.
|
|
363
|
-
|
|
364
|
-
Before:
|
|
365
|
-
|
|
366
|
-
```ruby
|
|
367
|
-
ActiveSupport::KeyGenerator.new(secret).inspect
|
|
368
|
-
"#<ActiveSupport::KeyGenerator:0x0000000104888038 ... @secret=\"\\xAF\\bFh]LV}q\\nl\\xB2U\\xB3 ... >"
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
After:
|
|
372
|
-
|
|
373
|
-
```ruby
|
|
374
|
-
ActiveSupport::KeyGenerator::Aes256Gcm(secret).inspect
|
|
375
|
-
"#<ActiveSupport::KeyGenerator:0x0000000104888038>"
|
|
376
|
-
```
|
|
377
|
-
|
|
378
|
-
*Petrik de Heus*
|
|
379
|
-
|
|
380
|
-
* Improve error message when EventedFileUpdateChecker is used without a
|
|
381
|
-
compatible version of the Listen gem
|
|
382
|
-
|
|
383
|
-
*Hartley McGuire*
|
|
384
|
-
|
|
385
|
-
* Add `:report` behavior for Deprecation
|
|
386
|
-
|
|
387
|
-
Setting `config.active_support.deprecation = :report` uses the error
|
|
388
|
-
reporter to report deprecation warnings to `ActiveSupport::ErrorReporter`.
|
|
389
|
-
|
|
390
|
-
Deprecations are reported as handled errors, with a severity of `:warning`.
|
|
391
|
-
|
|
392
|
-
Useful to report deprecations happening in production to your bug tracker.
|
|
393
|
-
|
|
394
|
-
*Étienne Barrié*
|
|
395
|
-
|
|
396
|
-
* Rename `Range#overlaps?` to `#overlap?` and add alias for backwards compatibility
|
|
397
|
-
|
|
398
|
-
*Christian Schmidt*
|
|
399
|
-
|
|
400
|
-
* Fix `EncryptedConfiguration` returning incorrect values for some `Hash`
|
|
401
|
-
methods
|
|
402
|
-
|
|
403
|
-
*Hartley McGuire*
|
|
404
|
-
|
|
405
|
-
* Don't show secrets for `MessageEncryptor#inspect`.
|
|
406
|
-
|
|
407
|
-
Before:
|
|
408
|
-
|
|
409
|
-
```ruby
|
|
410
|
-
ActiveSupport::MessageEncryptor.new(secret, cipher: "aes-256-gcm").inspect
|
|
411
|
-
"#<ActiveSupport::MessageEncryptor:0x0000000104888038 ... @secret=\"\\xAF\\bFh]LV}q\\nl\\xB2U\\xB3 ... >"
|
|
412
|
-
```
|
|
413
|
-
|
|
414
|
-
After:
|
|
415
|
-
|
|
416
|
-
```ruby
|
|
417
|
-
ActiveSupport::MessageEncryptor.new(secret, cipher: "aes-256-gcm").inspect
|
|
418
|
-
"#<ActiveSupport::MessageEncryptor:0x0000000104888038>"
|
|
419
|
-
```
|
|
420
|
-
|
|
421
|
-
*Petrik de Heus*
|
|
422
|
-
|
|
423
|
-
* Don't show contents for `EncryptedConfiguration#inspect`.
|
|
424
|
-
|
|
425
|
-
Before:
|
|
426
|
-
```ruby
|
|
427
|
-
Rails.application.credentials.inspect
|
|
428
|
-
"#<ActiveSupport::EncryptedConfiguration:0x000000010d2b38e8 ... @config={:secret=>\"something secret\"} ... @key_file_contents=\"915e4ea054e011022398dc242\" ...>"
|
|
429
|
-
```
|
|
430
|
-
|
|
431
|
-
After:
|
|
432
|
-
```ruby
|
|
433
|
-
Rails.application.credentials.inspect
|
|
434
|
-
"#<ActiveSupport::EncryptedConfiguration:0x000000010d2b38e8>"
|
|
435
|
-
```
|
|
436
|
-
|
|
437
|
-
*Petrik de Heus*
|
|
438
|
-
|
|
439
|
-
* `ERB::Util.html_escape_once` always returns an `html_safe` string.
|
|
440
|
-
|
|
441
|
-
This method previously maintained the `html_safe?` property of a string on the return
|
|
442
|
-
value. Because this string has been escaped, however, not marking it as `html_safe` causes
|
|
443
|
-
entities to be double-escaped.
|
|
444
|
-
|
|
445
|
-
As an example, take this view snippet:
|
|
446
|
-
|
|
447
|
-
```html
|
|
448
|
-
<p><%= html_escape_once("this & that & the other") %></p>
|
|
449
|
-
```
|
|
450
|
-
|
|
451
|
-
Before this change, that would be double-escaped and render as:
|
|
452
|
-
|
|
453
|
-
```html
|
|
454
|
-
<p>this &amp; that &amp; the other</p>
|
|
455
|
-
```
|
|
456
|
-
|
|
457
|
-
After this change, it renders correctly as:
|
|
458
|
-
|
|
459
|
-
```html
|
|
460
|
-
<p>this & that & the other</p>
|
|
461
|
-
```
|
|
462
|
-
|
|
463
|
-
Fixes #48256
|
|
464
|
-
|
|
465
|
-
*Mike Dalessio*
|
|
466
|
-
|
|
467
|
-
* Deprecate `SafeBuffer#clone_empty`.
|
|
468
|
-
|
|
469
|
-
This method has not been used internally since Rails 4.2.0.
|
|
470
|
-
|
|
471
|
-
*Mike Dalessio*
|
|
472
|
-
|
|
473
|
-
* `MessageEncryptor`, `MessageVerifier`, and `config.active_support.message_serializer`
|
|
474
|
-
now accept `:message_pack` and `:message_pack_allow_marshal` as serializers.
|
|
475
|
-
These serializers require the [`msgpack` gem](https://rubygems.org/gems/msgpack)
|
|
476
|
-
(>= 1.7.0).
|
|
477
|
-
|
|
478
|
-
The Message Pack format can provide improved performance and smaller payload
|
|
479
|
-
sizes. It also supports round-tripping some Ruby types that are not supported
|
|
480
|
-
by JSON. For example:
|
|
481
|
-
|
|
482
|
-
```ruby
|
|
483
|
-
verifier = ActiveSupport::MessageVerifier.new("secret")
|
|
484
|
-
data = [{ a: 1 }, { b: 2 }.with_indifferent_access, 1.to_d, Time.at(0, 123)]
|
|
485
|
-
message = verifier.generate(data)
|
|
486
|
-
|
|
487
|
-
# BEFORE with config.active_support.message_serializer = :json
|
|
488
|
-
verifier.verified(message)
|
|
489
|
-
# => [{"a"=>1}, {"b"=>2}, "1.0", "1969-12-31T18:00:00.000-06:00"]
|
|
490
|
-
verifier.verified(message).map(&:class)
|
|
491
|
-
# => [Hash, Hash, String, String]
|
|
492
|
-
|
|
493
|
-
# AFTER with config.active_support.message_serializer = :message_pack
|
|
494
|
-
verifier.verified(message)
|
|
495
|
-
# => [{:a=>1}, {"b"=>2}, 0.1e1, 1969-12-31 18:00:00.000123 -0600]
|
|
496
|
-
verifier.verified(message).map(&:class)
|
|
497
|
-
# => [Hash, ActiveSupport::HashWithIndifferentAccess, BigDecimal, Time]
|
|
498
|
-
```
|
|
499
|
-
|
|
500
|
-
The `:message_pack` serializer can fall back to deserializing with
|
|
501
|
-
`ActiveSupport::JSON` when necessary, and the `:message_pack_allow_marshal`
|
|
502
|
-
serializer can fall back to deserializing with `Marshal` as well as
|
|
503
|
-
`ActiveSupport::JSON`. Additionally, the `:marshal`, `:json`, and
|
|
504
|
-
`:json_allow_marshal` serializers can now fall back to deserializing with
|
|
505
|
-
`ActiveSupport::MessagePack` when necessary. These behaviors ensure old
|
|
506
|
-
messages can still be read so that migration is easier.
|
|
507
|
-
|
|
508
|
-
*Jonathan Hefner*
|
|
30
|
+
*Xavier Noria*
|
|
509
31
|
|
|
510
|
-
*
|
|
511
|
-
bare string values such as view fragments.
|
|
32
|
+
* Support `duration` type in `ActiveSupport::XmlMini`.
|
|
512
33
|
|
|
513
|
-
|
|
514
|
-
can enable the format by setting `config.load_defaults 7.1` or by setting
|
|
515
|
-
`config.active_support.cache_format_version = 7.1` in `config/application.rb`
|
|
516
|
-
or a `config/environments/*.rb` file.
|
|
34
|
+
*heka1024*
|
|
517
35
|
|
|
518
|
-
|
|
519
|
-
when using the `7.1` format. To perform a rolling deploy of a Rails 7.1
|
|
520
|
-
upgrade, wherein servers that have not yet been upgraded must be able to
|
|
521
|
-
read caches from upgraded servers, leave the cache format unchanged on the
|
|
522
|
-
first deploy, then enable the `7.1` cache format on a subsequent deploy.
|
|
36
|
+
* Remove deprecated `ActiveSupport::Notifications::Event#children` and `ActiveSupport::Notifications::Event#parent_of?`.
|
|
523
37
|
|
|
524
|
-
*
|
|
525
|
-
|
|
526
|
-
* Active Support cache stores can now use a preconfigured serializer based on
|
|
527
|
-
`ActiveSupport::MessagePack` via the `:serializer` option:
|
|
528
|
-
|
|
529
|
-
```ruby
|
|
530
|
-
config.cache_store = :redis_cache_store, { serializer: :message_pack }
|
|
531
|
-
```
|
|
532
|
-
|
|
533
|
-
The `:message_pack` serializer can reduce cache entry sizes and improve
|
|
534
|
-
performance, but requires the [`msgpack` gem](https://rubygems.org/gems/msgpack)
|
|
535
|
-
(>= 1.7.0).
|
|
536
|
-
|
|
537
|
-
The `:message_pack` serializer can read cache entries written by the default
|
|
538
|
-
serializer, and the default serializer can now read entries written by the
|
|
539
|
-
`:message_pack` serializer. These behaviors make it easy to migrate between
|
|
540
|
-
serializer without invalidating the entire cache.
|
|
541
|
-
|
|
542
|
-
*Jonathan Hefner*
|
|
543
|
-
|
|
544
|
-
* `Object#deep_dup` no longer duplicate named classes and modules.
|
|
545
|
-
|
|
546
|
-
Before:
|
|
547
|
-
|
|
548
|
-
```ruby
|
|
549
|
-
hash = { class: Object, module: Kernel }
|
|
550
|
-
hash.deep_dup # => {:class=>#<Class:0x00000001063ffc80>, :module=>#<Module:0x00000001063ffa00>}
|
|
551
|
-
```
|
|
552
|
-
|
|
553
|
-
After:
|
|
554
|
-
|
|
555
|
-
```ruby
|
|
556
|
-
hash = { class: Object, module: Kernel }
|
|
557
|
-
hash.deep_dup # => {:class=>Object, :module=>Kernel}
|
|
558
|
-
```
|
|
559
|
-
|
|
560
|
-
*Jean Boussier*
|
|
561
|
-
|
|
562
|
-
* Consistently raise an `ArgumentError` if the `ActiveSupport::Cache` key is blank.
|
|
563
|
-
|
|
564
|
-
*Joshua Young*
|
|
565
|
-
|
|
566
|
-
* Deprecate usage of the singleton `ActiveSupport::Deprecation`.
|
|
567
|
-
|
|
568
|
-
All usage of `ActiveSupport::Deprecation` as a singleton is deprecated, the most common one being
|
|
569
|
-
`ActiveSupport::Deprecation.warn`. Gem authors should now create their own deprecator (`ActiveSupport::Deprecation`
|
|
570
|
-
object), and use it to emit deprecation warnings.
|
|
571
|
-
|
|
572
|
-
Calling any of the following without specifying a deprecator argument is also deprecated:
|
|
573
|
-
* Module.deprecate
|
|
574
|
-
* deprecate_constant
|
|
575
|
-
* DeprecatedObjectProxy
|
|
576
|
-
* DeprecatedInstanceVariableProxy
|
|
577
|
-
* DeprecatedConstantProxy
|
|
578
|
-
* deprecation-related test assertions
|
|
579
|
-
|
|
580
|
-
Use of `ActiveSupport::Deprecation.silence` and configuration methods like `behavior=`, `disallowed_behavior=`,
|
|
581
|
-
`disallowed_warnings=` should now be aimed at the [application's deprecators](https://api.rubyonrails.org/classes/Rails/Application.html#method-i-deprecators).
|
|
582
|
-
|
|
583
|
-
```ruby
|
|
584
|
-
Rails.application.deprecators.silence do
|
|
585
|
-
# code that emits deprecation warnings
|
|
586
|
-
end
|
|
587
|
-
```
|
|
588
|
-
|
|
589
|
-
If your gem has a Railtie or Engine, it's encouraged to add your deprecator to the application's deprecators, that
|
|
590
|
-
way the deprecation related configuration options will apply to it as well, e.g.
|
|
591
|
-
`config.active_support.report_deprecations` set to `false` in the production environment will also disable your
|
|
592
|
-
deprecator.
|
|
593
|
-
|
|
594
|
-
```ruby
|
|
595
|
-
initializer "my_gem.deprecator" do |app|
|
|
596
|
-
app.deprecators[:my_gem] = MyGem.deprecator
|
|
597
|
-
end
|
|
598
|
-
```
|
|
599
|
-
|
|
600
|
-
*Étienne Barrié*
|
|
38
|
+
*Rafael Mendonça França*
|
|
601
39
|
|
|
602
|
-
*
|
|
40
|
+
* Remove deprecated support to call the following methods without passing a deprecator:
|
|
603
41
|
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
42
|
+
- `deprecate`
|
|
43
|
+
- `deprecate_constant`
|
|
44
|
+
- `ActiveSupport::Deprecation::DeprecatedObjectProxy.new`
|
|
45
|
+
- `ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.new`
|
|
46
|
+
- `ActiveSupport::Deprecation::DeprecatedConstantProxy.new`
|
|
47
|
+
- `assert_deprecated`
|
|
48
|
+
- `assert_not_deprecated`
|
|
49
|
+
- `collect_deprecations`
|
|
611
50
|
|
|
612
|
-
*
|
|
51
|
+
*Rafael Mendonça França*
|
|
613
52
|
|
|
614
|
-
* Remove deprecated
|
|
615
|
-
constants defined on `Digest::UUID`.
|
|
53
|
+
* Remove deprecated `ActiveSupport::Deprecation` delegation to instance.
|
|
616
54
|
|
|
617
55
|
*Rafael Mendonça França*
|
|
618
56
|
|
|
619
|
-
*
|
|
57
|
+
* Remove deprecated `SafeBuffer#clone_empty`.
|
|
620
58
|
|
|
621
59
|
*Rafael Mendonça França*
|
|
622
60
|
|
|
623
|
-
* Remove
|
|
61
|
+
* Remove deprecated `#to_default_s` from `Array`, `Date`, `DateTime` and `Time`.
|
|
624
62
|
|
|
625
63
|
*Rafael Mendonça França*
|
|
626
64
|
|
|
627
|
-
* Remove deprecated `
|
|
65
|
+
* Remove deprecated support to passing `Dalli::Client` instances to `MemCacheStore`.
|
|
628
66
|
|
|
629
67
|
*Rafael Mendonça França*
|
|
630
68
|
|
|
631
|
-
*
|
|
69
|
+
* Remove deprecated `config.active_support.use_rfc4122_namespaced_uuids`.
|
|
632
70
|
|
|
633
71
|
*Rafael Mendonça França*
|
|
634
72
|
|
|
635
|
-
* Remove deprecated
|
|
73
|
+
* Remove deprecated `config.active_support.remove_deprecated_time_with_zone_name`.
|
|
636
74
|
|
|
637
75
|
*Rafael Mendonça França*
|
|
638
76
|
|
|
639
|
-
*
|
|
77
|
+
* Remove deprecated `config.active_support.disable_to_s_conversion`.
|
|
640
78
|
|
|
641
79
|
*Rafael Mendonça França*
|
|
642
80
|
|
|
643
|
-
* Remove deprecated
|
|
644
|
-
`BigDecimal`, `Float` and, `Integer`.
|
|
81
|
+
* Remove deprecated support to bolding log text with positional boolean in `ActiveSupport::LogSubscriber#color`.
|
|
645
82
|
|
|
646
83
|
*Rafael Mendonça França*
|
|
647
84
|
|
|
648
|
-
* Remove deprecated `ActiveSupport::
|
|
85
|
+
* Remove deprecated constants `ActiveSupport::LogSubscriber::CLEAR` and `ActiveSupport::LogSubscriber::BOLD`.
|
|
649
86
|
|
|
650
87
|
*Rafael Mendonça França*
|
|
651
88
|
|
|
652
|
-
* Remove deprecated
|
|
89
|
+
* Remove deprecated support for `config.active_support.cache_format_version = 6.1`.
|
|
653
90
|
|
|
654
91
|
*Rafael Mendonça França*
|
|
655
92
|
|
|
656
|
-
*
|
|
657
|
-
|
|
658
|
-
Deprecate the undocumented option of providing an already-initialized instance of `Dalli::Client` to `ActiveSupport::Cache::MemCacheStore`. Such clients could be configured with unrecognized options, which could lead to unexpected behavior. Instead, provide addresses as documented.
|
|
93
|
+
* Remove deprecated `:pool_size` and `:pool_timeout` options for the cache storage.
|
|
659
94
|
|
|
660
|
-
*
|
|
95
|
+
*Rafael Mendonça França*
|
|
661
96
|
|
|
662
|
-
*
|
|
97
|
+
* Warn on tests without assertions.
|
|
663
98
|
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
# Inside the `travel_to` block `Time.new` is stubbed
|
|
667
|
-
assert_equal 2004, Time.new.year
|
|
668
|
-
end
|
|
669
|
-
```
|
|
99
|
+
`ActiveSupport::TestCase` now warns when tests do not run any assertions.
|
|
100
|
+
This is helpful in detecting broken tests that do not perform intended assertions.
|
|
670
101
|
|
|
671
102
|
*fatkodima*
|
|
672
103
|
|
|
673
|
-
*
|
|
674
|
-
`ActiveSupport::MessageEncryptor#decrypt_and_verify` regardless of cipher.
|
|
675
|
-
Previously, when a `MessageEncryptor` was using a non-AEAD cipher such as
|
|
676
|
-
AES-256-CBC, a corrupt or tampered message would raise
|
|
677
|
-
`ActiveSupport::MessageVerifier::InvalidSignature`. Now, all ciphers raise
|
|
678
|
-
the same error:
|
|
679
|
-
|
|
680
|
-
```ruby
|
|
681
|
-
encryptor = ActiveSupport::MessageEncryptor.new("x" * 32, cipher: "aes-256-gcm")
|
|
682
|
-
message = encryptor.encrypt_and_sign("message")
|
|
683
|
-
encryptor.decrypt_and_verify(message.next)
|
|
684
|
-
# => raises ActiveSupport::MessageEncryptor::InvalidMessage
|
|
685
|
-
|
|
686
|
-
encryptor = ActiveSupport::MessageEncryptor.new("x" * 32, cipher: "aes-256-cbc")
|
|
687
|
-
message = encryptor.encrypt_and_sign("message")
|
|
688
|
-
encryptor.decrypt_and_verify(message.next)
|
|
689
|
-
# BEFORE:
|
|
690
|
-
# => raises ActiveSupport::MessageVerifier::InvalidSignature
|
|
691
|
-
# AFTER:
|
|
692
|
-
# => raises ActiveSupport::MessageEncryptor::InvalidMessage
|
|
693
|
-
```
|
|
694
|
-
|
|
695
|
-
*Jonathan Hefner*
|
|
696
|
-
|
|
697
|
-
* Support `nil` original values when using `ActiveSupport::MessageVerifier#verify`.
|
|
698
|
-
Previously, `MessageVerifier#verify` did not work with `nil` original
|
|
699
|
-
values, though both `MessageVerifier#verified` and
|
|
700
|
-
`MessageEncryptor#decrypt_and_verify` do:
|
|
701
|
-
|
|
702
|
-
```ruby
|
|
703
|
-
encryptor = ActiveSupport::MessageEncryptor.new(secret)
|
|
704
|
-
message = encryptor.encrypt_and_sign(nil)
|
|
705
|
-
|
|
706
|
-
encryptor.decrypt_and_verify(message)
|
|
707
|
-
# => nil
|
|
708
|
-
|
|
709
|
-
verifier = ActiveSupport::MessageVerifier.new(secret)
|
|
710
|
-
message = verifier.generate(nil)
|
|
711
|
-
|
|
712
|
-
verifier.verified(message)
|
|
713
|
-
# => nil
|
|
714
|
-
|
|
715
|
-
verifier.verify(message)
|
|
716
|
-
# BEFORE:
|
|
717
|
-
# => raises ActiveSupport::MessageVerifier::InvalidSignature
|
|
718
|
-
# AFTER:
|
|
719
|
-
# => nil
|
|
720
|
-
```
|
|
721
|
-
|
|
722
|
-
*Jonathan Hefner*
|
|
723
|
-
|
|
724
|
-
* Maintain `html_safe?` on html_safe strings when sliced with `slice`, `slice!`, or `chr` method.
|
|
725
|
-
|
|
726
|
-
Previously, `html_safe?` was only maintained when the html_safe strings were sliced
|
|
727
|
-
with `[]` method. Now, `slice`, `slice!`, and `chr` methods will maintain `html_safe?` like `[]` method.
|
|
728
|
-
|
|
729
|
-
```ruby
|
|
730
|
-
string = "<div>test</div>".html_safe
|
|
731
|
-
string.slice(0, 1).html_safe? # => true
|
|
732
|
-
string.slice!(0, 1).html_safe? # => true
|
|
733
|
-
# maintain html_safe? after the slice!
|
|
734
|
-
string.html_safe? # => true
|
|
735
|
-
string.chr.html_safe? # => true
|
|
736
|
-
```
|
|
737
|
-
|
|
738
|
-
*Michael Go*
|
|
739
|
-
|
|
740
|
-
* Add `Object#in?` support for open ranges.
|
|
741
|
-
|
|
742
|
-
```ruby
|
|
743
|
-
assert Date.today.in?(..Date.tomorrow)
|
|
744
|
-
assert_not Date.today.in?(Date.tomorrow..)
|
|
745
|
-
```
|
|
746
|
-
|
|
747
|
-
*Ignacio Galindo*
|
|
748
|
-
|
|
749
|
-
* `config.i18n.raise_on_missing_translations = true` now raises on any missing translation.
|
|
750
|
-
|
|
751
|
-
Previously it would only raise when called in a view or controller. Now it will raise
|
|
752
|
-
anytime `I18n.t` is provided an unrecognised key.
|
|
753
|
-
|
|
754
|
-
If you do not want this behaviour, you can customise the i18n exception handler. See the
|
|
755
|
-
upgrading guide or i18n guide for more information.
|
|
756
|
-
|
|
757
|
-
*Alex Ghiculescu*
|
|
758
|
-
|
|
759
|
-
* `ActiveSupport::CurrentAttributes` now raises if a restricted attribute name is used.
|
|
760
|
-
|
|
761
|
-
Attributes such as `set` and `reset` cannot be used as they clash with the
|
|
762
|
-
`CurrentAttributes` public API.
|
|
104
|
+
* Support `hexBinary` type in `ActiveSupport::XmlMini`.
|
|
763
105
|
|
|
764
|
-
*
|
|
106
|
+
*heka1024*
|
|
765
107
|
|
|
766
|
-
* `
|
|
767
|
-
as Ruby's `Hash#transform_keys` does.
|
|
768
|
-
|
|
769
|
-
*Akira Matsuda*
|
|
770
|
-
|
|
771
|
-
* `delegate` now defines method with proper arity when delegating to a Class.
|
|
772
|
-
With this change, it defines faster method (3.5x faster with no argument).
|
|
773
|
-
However, in order to gain this benefit, the delegation target method has to
|
|
774
|
-
be defined before declaring the delegation.
|
|
775
|
-
|
|
776
|
-
```ruby
|
|
777
|
-
# This defines 3.5 times faster method than before
|
|
778
|
-
class C
|
|
779
|
-
def self.x() end
|
|
780
|
-
delegate :x, to: :class
|
|
781
|
-
end
|
|
782
|
-
|
|
783
|
-
class C
|
|
784
|
-
# This works but silently falls back to old behavior because
|
|
785
|
-
# `delegate` cannot find the definition of `x`
|
|
786
|
-
delegate :x, to: :class
|
|
787
|
-
def self.x() end
|
|
788
|
-
end
|
|
789
|
-
```
|
|
108
|
+
* Deprecate `ActiveSupport::ProxyObject` in favor of Ruby's built-in `BasicObject`.
|
|
790
109
|
|
|
791
|
-
*
|
|
110
|
+
*Earlopain*
|
|
792
111
|
|
|
793
|
-
* `
|
|
112
|
+
* `stub_const` now accepts a `exists: false` parameter to allow stubbing missing constants.
|
|
794
113
|
|
|
795
|
-
|
|
114
|
+
*Jean Boussier*
|
|
796
115
|
|
|
797
|
-
|
|
116
|
+
* Make `ActiveSupport::BacktraceCleaner` copy filters and silencers on dup and clone.
|
|
798
117
|
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
Expected: 1611
|
|
802
|
-
Actual: 1579
|
|
803
|
-
```
|
|
118
|
+
Previously the copy would still share the internal silencers and filters array,
|
|
119
|
+
causing state to leak.
|
|
804
120
|
|
|
805
|
-
|
|
121
|
+
*Jean Boussier*
|
|
806
122
|
|
|
807
|
-
|
|
808
|
-
"User.count" didn't change by 32, but by 0.
|
|
809
|
-
Expected: 1611
|
|
810
|
-
Actual: 1579
|
|
811
|
-
```
|
|
123
|
+
* Updating Astana with Western Kazakhstan TZInfo identifier.
|
|
812
124
|
|
|
813
|
-
*
|
|
125
|
+
*Damian Nelson*
|
|
814
126
|
|
|
815
|
-
* Add
|
|
127
|
+
* Add filename support for `ActiveSupport::Logger.logger_outputs_to?`.
|
|
816
128
|
|
|
817
|
-
Instead of this
|
|
818
129
|
```ruby
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
end
|
|
822
|
-
assert_match(/incorrect param/i, error.message)
|
|
130
|
+
logger = Logger.new('/var/log/rails.log')
|
|
131
|
+
ActiveSupport::Logger.logger_outputs_to?(logger, '/var/log/rails.log')
|
|
823
132
|
```
|
|
824
133
|
|
|
825
|
-
|
|
826
|
-
```ruby
|
|
827
|
-
assert_raises(ArgumentError, match: /incorrect param/i) do
|
|
828
|
-
perform_service(param: 'exception')
|
|
829
|
-
end
|
|
830
|
-
```
|
|
831
|
-
|
|
832
|
-
*fatkodima*
|
|
833
|
-
|
|
834
|
-
* Add `Rails.env.local?` shorthand for `Rails.env.development? || Rails.env.test?`.
|
|
835
|
-
|
|
836
|
-
*DHH*
|
|
134
|
+
*Christian Schmidt*
|
|
837
135
|
|
|
838
|
-
* `
|
|
839
|
-
|
|
840
|
-
truncating the destination time with `change(usec: 0)`.
|
|
136
|
+
* Include `IPAddr#prefix` when serializing an `IPAddr` using the
|
|
137
|
+
`ActiveSupport::MessagePack` serializer.
|
|
841
138
|
|
|
842
|
-
|
|
139
|
+
This change is backward and forward compatible — old payloads can
|
|
140
|
+
still be read, and new payloads will be readable by older versions of Rails.
|
|
843
141
|
|
|
844
|
-
*
|
|
142
|
+
*Taiki Komaba*
|
|
845
143
|
|
|
846
|
-
|
|
144
|
+
* Add `default:` support for `ActiveSupport::CurrentAttributes.attribute`.
|
|
847
145
|
|
|
848
146
|
```ruby
|
|
849
147
|
class Current < ActiveSupport::CurrentAttributes
|
|
850
|
-
|
|
851
|
-
resets :clear_time_zone
|
|
148
|
+
attribute :counter, default: 0
|
|
852
149
|
end
|
|
853
150
|
```
|
|
854
151
|
|
|
855
|
-
*
|
|
856
|
-
|
|
857
|
-
* Ensure `ActiveSupport::Testing::Isolation::Forking` closes pipes
|
|
858
|
-
|
|
859
|
-
Previously, `Forking.run_in_isolation` opened two ends of a pipe. The fork
|
|
860
|
-
process closed the read end, wrote to it, and then terminated (which
|
|
861
|
-
presumably closed the file descriptors on its end). The parent process
|
|
862
|
-
closed the write end, read from it, and returned, never closing the read
|
|
863
|
-
end.
|
|
864
|
-
|
|
865
|
-
This resulted in an accumulation of open file descriptors, which could
|
|
866
|
-
cause errors if the limit is reached.
|
|
867
|
-
|
|
868
|
-
*Sam Bostock*
|
|
869
|
-
|
|
870
|
-
* Fix `Time#change` and `Time#advance` for times around the end of Daylight
|
|
871
|
-
Saving Time.
|
|
872
|
-
|
|
873
|
-
Previously, when `Time#change` or `Time#advance` constructed a time inside
|
|
874
|
-
the final stretch of Daylight Saving Time (DST), the non-DST offset would
|
|
875
|
-
always be chosen for local times:
|
|
876
|
-
|
|
877
|
-
```ruby
|
|
878
|
-
# DST ended just before 2021-11-07 2:00:00 AM in US/Eastern.
|
|
879
|
-
ENV["TZ"] = "US/Eastern"
|
|
880
|
-
|
|
881
|
-
time = Time.local(2021, 11, 07, 00, 59, 59) + 1
|
|
882
|
-
# => 2021-11-07 01:00:00 -0400
|
|
883
|
-
time.change(day: 07)
|
|
884
|
-
# => 2021-11-07 01:00:00 -0500
|
|
885
|
-
time.advance(seconds: 0)
|
|
886
|
-
# => 2021-11-07 01:00:00 -0500
|
|
887
|
-
|
|
888
|
-
time = Time.local(2021, 11, 06, 01, 00, 00)
|
|
889
|
-
# => 2021-11-06 01:00:00 -0400
|
|
890
|
-
time.change(day: 07)
|
|
891
|
-
# => 2021-11-07 01:00:00 -0500
|
|
892
|
-
time.advance(days: 1)
|
|
893
|
-
# => 2021-11-07 01:00:00 -0500
|
|
894
|
-
```
|
|
895
|
-
|
|
896
|
-
And the DST offset would always be chosen for times with a `TimeZone`
|
|
897
|
-
object:
|
|
898
|
-
|
|
899
|
-
```ruby
|
|
900
|
-
Time.zone = "US/Eastern"
|
|
901
|
-
|
|
902
|
-
time = Time.new(2021, 11, 07, 02, 00, 00, Time.zone) - 3600
|
|
903
|
-
# => 2021-11-07 01:00:00 -0500
|
|
904
|
-
time.change(day: 07)
|
|
905
|
-
# => 2021-11-07 01:00:00 -0400
|
|
906
|
-
time.advance(seconds: 0)
|
|
907
|
-
# => 2021-11-07 01:00:00 -0400
|
|
908
|
-
|
|
909
|
-
time = Time.new(2021, 11, 8, 01, 00, 00, Time.zone)
|
|
910
|
-
# => 2021-11-08 01:00:00 -0500
|
|
911
|
-
time.change(day: 07)
|
|
912
|
-
# => 2021-11-07 01:00:00 -0400
|
|
913
|
-
time.advance(days: -1)
|
|
914
|
-
# => 2021-11-07 01:00:00 -0400
|
|
915
|
-
```
|
|
152
|
+
*Sean Doyle*
|
|
916
153
|
|
|
917
|
-
|
|
918
|
-
the original time's offset when possible:
|
|
154
|
+
* Yield instance to `Object#with` block.
|
|
919
155
|
|
|
920
156
|
```ruby
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
time = Time.local(2021, 11, 07, 00, 59, 59) + 1
|
|
924
|
-
# => 2021-11-07 01:00:00 -0400
|
|
925
|
-
time.change(day: 07)
|
|
926
|
-
# => 2021-11-07 01:00:00 -0400
|
|
927
|
-
time.advance(seconds: 0)
|
|
928
|
-
# => 2021-11-07 01:00:00 -0400
|
|
929
|
-
|
|
930
|
-
time = Time.local(2021, 11, 06, 01, 00, 00)
|
|
931
|
-
# => 2021-11-06 01:00:00 -0400
|
|
932
|
-
time.change(day: 07)
|
|
933
|
-
# => 2021-11-07 01:00:00 -0400
|
|
934
|
-
time.advance(days: 1)
|
|
935
|
-
# => 2021-11-07 01:00:00 -0400
|
|
936
|
-
|
|
937
|
-
Time.zone = "US/Eastern"
|
|
938
|
-
|
|
939
|
-
time = Time.new(2021, 11, 07, 02, 00, 00, Time.zone) - 3600
|
|
940
|
-
# => 2021-11-07 01:00:00 -0500
|
|
941
|
-
time.change(day: 07)
|
|
942
|
-
# => 2021-11-07 01:00:00 -0500
|
|
943
|
-
time.advance(seconds: 0)
|
|
944
|
-
# => 2021-11-07 01:00:00 -0500
|
|
945
|
-
|
|
946
|
-
time = Time.new(2021, 11, 8, 01, 00, 00, Time.zone)
|
|
947
|
-
# => 2021-11-08 01:00:00 -0500
|
|
948
|
-
time.change(day: 07)
|
|
949
|
-
# => 2021-11-07 01:00:00 -0500
|
|
950
|
-
time.advance(days: -1)
|
|
951
|
-
# => 2021-11-07 01:00:00 -0500
|
|
952
|
-
```
|
|
953
|
-
|
|
954
|
-
*Kevin Hall*, *Takayoshi Nishida*, and *Jonathan Hefner*
|
|
955
|
-
|
|
956
|
-
* Fix MemoryStore to preserve entries TTL when incrementing or decrementing
|
|
957
|
-
|
|
958
|
-
This is to be more consistent with how MemCachedStore and RedisCacheStore behaves.
|
|
959
|
-
|
|
960
|
-
*Jean Boussier*
|
|
961
|
-
|
|
962
|
-
* `Rails.error.handle` and `Rails.error.record` filter now by multiple error classes.
|
|
963
|
-
|
|
964
|
-
```ruby
|
|
965
|
-
Rails.error.handle(IOError, ArgumentError) do
|
|
966
|
-
1 + '1' # raises TypeError
|
|
157
|
+
client.with(timeout: 5_000) do |c|
|
|
158
|
+
c.get("/commits")
|
|
967
159
|
end
|
|
968
|
-
1 + 1 # TypeErrors are not IOErrors or ArgumentError, so this will *not* be handled
|
|
969
160
|
```
|
|
970
161
|
|
|
971
|
-
*
|
|
972
|
-
|
|
973
|
-
* `Class#subclasses` and `Class#descendants` now automatically filter reloaded classes.
|
|
162
|
+
*Sean Doyle*
|
|
974
163
|
|
|
975
|
-
|
|
976
|
-
|
|
164
|
+
* Use logical core count instead of physical core count to determine the
|
|
165
|
+
default number of workers when parallelizing tests.
|
|
977
166
|
|
|
978
|
-
|
|
979
|
-
`DescendantTracker#descendants`.
|
|
980
|
-
|
|
981
|
-
*Jean Boussier*
|
|
982
|
-
|
|
983
|
-
* `Rails.error.report` now marks errors as reported to avoid reporting them twice.
|
|
167
|
+
*Jonathan Hefner*
|
|
984
168
|
|
|
985
|
-
|
|
986
|
-
before letting it bubble up.
|
|
169
|
+
* Fix `Time.now/DateTime.now/Date.today` to return results in a system timezone after `#travel_to`.
|
|
987
170
|
|
|
988
|
-
|
|
171
|
+
There is a bug in the current implementation of #travel_to:
|
|
172
|
+
it remembers a timezone of its argument, and all stubbed methods start
|
|
173
|
+
returning results in that remembered timezone. However, the expected
|
|
174
|
+
behavior is to return results in a system timezone.
|
|
989
175
|
|
|
990
|
-
*
|
|
176
|
+
*Aleksei Chernenkov*
|
|
991
177
|
|
|
992
|
-
* Add `
|
|
178
|
+
* Add `ErrorReported#unexpected` to report precondition violations.
|
|
993
179
|
|
|
994
|
-
|
|
180
|
+
For example:
|
|
995
181
|
|
|
996
182
|
```ruby
|
|
997
|
-
|
|
183
|
+
def edit
|
|
184
|
+
if published?
|
|
185
|
+
Rails.error.unexpected("[BUG] Attempting to edit a published article, that shouldn't be possible")
|
|
186
|
+
return false
|
|
187
|
+
end
|
|
998
188
|
# ...
|
|
999
189
|
end
|
|
1000
|
-
assert_equal "Oops", report.error.message
|
|
1001
|
-
assert_equal "admin", report.context[:section]
|
|
1002
|
-
assert_equal :warning, report.severity
|
|
1003
|
-
assert_predicate report, :handled?
|
|
1004
|
-
```
|
|
1005
|
-
|
|
1006
|
-
*Jean Boussier*
|
|
1007
|
-
|
|
1008
|
-
* `ActiveSupport::Deprecation` behavior callbacks can now receive the
|
|
1009
|
-
deprecator instance as an argument. This makes it easier for such callbacks
|
|
1010
|
-
to change their behavior based on the deprecator's state. For example,
|
|
1011
|
-
based on the deprecator's `debug` flag.
|
|
1012
|
-
|
|
1013
|
-
3-arity and splat-args callbacks such as the following will now be passed
|
|
1014
|
-
the deprecator instance as their third argument:
|
|
1015
|
-
|
|
1016
|
-
* `->(message, callstack, deprecator) { ... }`
|
|
1017
|
-
* `->(*args) { ... }`
|
|
1018
|
-
* `->(message, *other_args) { ... }`
|
|
1019
|
-
|
|
1020
|
-
2-arity and 4-arity callbacks such as the following will continue to behave
|
|
1021
|
-
the same as before:
|
|
1022
|
-
|
|
1023
|
-
* `->(message, callstack) { ... }`
|
|
1024
|
-
* `->(message, callstack, deprecation_horizon, gem_name) { ... }`
|
|
1025
|
-
* `->(message, callstack, *deprecation_details) { ... }`
|
|
1026
|
-
|
|
1027
|
-
*Jonathan Hefner*
|
|
1028
|
-
|
|
1029
|
-
* `ActiveSupport::Deprecation#disallowed_warnings` now affects the instance on
|
|
1030
|
-
which it is configured.
|
|
1031
|
-
|
|
1032
|
-
This means that individual `ActiveSupport::Deprecation` instances can be
|
|
1033
|
-
configured with their own disallowed warnings, and the global
|
|
1034
|
-
`ActiveSupport::Deprecation.disallowed_warnings` now only affects the global
|
|
1035
|
-
`ActiveSupport::Deprecation.warn`.
|
|
1036
|
-
|
|
1037
|
-
**Before**
|
|
1038
|
-
|
|
1039
|
-
```ruby
|
|
1040
|
-
ActiveSupport::Deprecation.disallowed_warnings = ["foo"]
|
|
1041
|
-
deprecator = ActiveSupport::Deprecation.new("2.0", "MyCoolGem")
|
|
1042
|
-
deprecator.disallowed_warnings = ["bar"]
|
|
1043
|
-
|
|
1044
|
-
ActiveSupport::Deprecation.warn("foo") # => raise ActiveSupport::DeprecationException
|
|
1045
|
-
ActiveSupport::Deprecation.warn("bar") # => print "DEPRECATION WARNING: bar"
|
|
1046
|
-
deprecator.warn("foo") # => raise ActiveSupport::DeprecationException
|
|
1047
|
-
deprecator.warn("bar") # => print "DEPRECATION WARNING: bar"
|
|
1048
|
-
```
|
|
1049
|
-
|
|
1050
|
-
**After**
|
|
1051
|
-
|
|
1052
|
-
```ruby
|
|
1053
|
-
ActiveSupport::Deprecation.disallowed_warnings = ["foo"]
|
|
1054
|
-
deprecator = ActiveSupport::Deprecation.new("2.0", "MyCoolGem")
|
|
1055
|
-
deprecator.disallowed_warnings = ["bar"]
|
|
1056
|
-
|
|
1057
|
-
ActiveSupport::Deprecation.warn("foo") # => raise ActiveSupport::DeprecationException
|
|
1058
|
-
ActiveSupport::Deprecation.warn("bar") # => print "DEPRECATION WARNING: bar"
|
|
1059
|
-
deprecator.warn("foo") # => print "DEPRECATION WARNING: foo"
|
|
1060
|
-
deprecator.warn("bar") # => raise ActiveSupport::DeprecationException
|
|
1061
|
-
```
|
|
1062
|
-
|
|
1063
|
-
Note that global `ActiveSupport::Deprecation` methods such as `ActiveSupport::Deprecation.warn`
|
|
1064
|
-
and `ActiveSupport::Deprecation.disallowed_warnings` have been deprecated.
|
|
1065
|
-
|
|
1066
|
-
*Jonathan Hefner*
|
|
1067
|
-
|
|
1068
|
-
* Add italic and underline support to `ActiveSupport::LogSubscriber#color`
|
|
1069
|
-
|
|
1070
|
-
Previously, only bold text was supported via a positional argument.
|
|
1071
|
-
This allows for bold, italic, and underline options to be specified
|
|
1072
|
-
for colored logs.
|
|
1073
|
-
|
|
1074
|
-
```ruby
|
|
1075
|
-
info color("Hello world!", :red, bold: true, underline: true)
|
|
1076
190
|
```
|
|
1077
191
|
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
* Add `String#downcase_first` method.
|
|
1081
|
-
|
|
1082
|
-
This method is the corollary of `String#upcase_first`.
|
|
1083
|
-
|
|
1084
|
-
*Mark Schneider*
|
|
1085
|
-
|
|
1086
|
-
* `thread_mattr_accessor` will call `.dup.freeze` on non-frozen default values.
|
|
1087
|
-
|
|
1088
|
-
This provides a basic level of protection against different threads trying
|
|
1089
|
-
to mutate a shared default object.
|
|
1090
|
-
|
|
1091
|
-
*Jonathan Hefner*
|
|
1092
|
-
|
|
1093
|
-
* Add `raise_on_invalid_cache_expiration_time` config to `ActiveSupport::Cache::Store`
|
|
1094
|
-
|
|
1095
|
-
Specifies if an `ArgumentError` should be raised if `Rails.cache` `fetch` or
|
|
1096
|
-
`write` are given an invalid `expires_at` or `expires_in` time.
|
|
1097
|
-
|
|
1098
|
-
Options are `true`, and `false`. If `false`, the exception will be reported
|
|
1099
|
-
as `handled` and logged instead. Defaults to `true` if `config.load_defaults >= 7.1`.
|
|
1100
|
-
|
|
1101
|
-
*Trevor Turk*
|
|
1102
|
-
|
|
1103
|
-
* `ActiveSupport::Cache::Store#fetch` now passes an options accessor to the block.
|
|
1104
|
-
|
|
1105
|
-
It makes possible to override cache options:
|
|
1106
|
-
|
|
1107
|
-
Rails.cache.fetch("3rd-party-token") do |name, options|
|
|
1108
|
-
token = fetch_token_from_remote
|
|
1109
|
-
# set cache's TTL to match token's TTL
|
|
1110
|
-
options.expires_in = token.expires_in
|
|
1111
|
-
token
|
|
1112
|
-
end
|
|
1113
|
-
|
|
1114
|
-
*Andrii Gladkyi*, *Jean Boussier*
|
|
1115
|
-
|
|
1116
|
-
* `default` option of `thread_mattr_accessor` now applies through inheritance and
|
|
1117
|
-
also across new threads.
|
|
1118
|
-
|
|
1119
|
-
Previously, the `default` value provided was set only at the moment of defining
|
|
1120
|
-
the attribute writer, which would cause the attribute to be uninitialized in
|
|
1121
|
-
descendants and in other threads.
|
|
1122
|
-
|
|
1123
|
-
Fixes #43312.
|
|
1124
|
-
|
|
1125
|
-
*Thierry Deo*
|
|
1126
|
-
|
|
1127
|
-
* Redis cache store is now compatible with redis-rb 5.0.
|
|
192
|
+
The above will raise an error in development and test, but only report the error in production.
|
|
1128
193
|
|
|
1129
194
|
*Jean Boussier*
|
|
1130
195
|
|
|
1131
|
-
*
|
|
196
|
+
* Make the order of read_multi and write_multi notifications for `Cache::Store#fetch_multi` operations match the order they are executed in.
|
|
1132
197
|
|
|
1133
|
-
*
|
|
198
|
+
*Adam Renberg Tamm*
|
|
1134
199
|
|
|
1135
|
-
*
|
|
200
|
+
* Make return values of `Cache::Store#write` consistent.
|
|
1136
201
|
|
|
1137
|
-
|
|
202
|
+
The return value was not specified before. Now it returns `true` on a successful write,
|
|
203
|
+
`nil` if there was an error talking to the cache backend, and `false` if the write failed
|
|
204
|
+
for another reason (e.g. the key already exists and `unless_exist: true` was passed).
|
|
1138
205
|
|
|
1139
|
-
*
|
|
206
|
+
*Sander Verdonschot*
|
|
1140
207
|
|
|
1141
|
-
|
|
1142
|
-
that responds to `call`, but in fact its internal implementation assumed that
|
|
1143
|
-
this object could respond to `arity`, so it was restricted to only `Proc` objects.
|
|
208
|
+
* Fix logged cache keys not always matching actual key used by cache action.
|
|
1144
209
|
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
*Ryo Nakamura*
|
|
1148
|
-
|
|
1149
|
-
* Support `:url_safe` option for `MessageEncryptor`.
|
|
210
|
+
*Hartley McGuire*
|
|
1150
211
|
|
|
1151
|
-
|
|
1152
|
-
to the `MessageVerifier` constructor. When enabled, this option ensures
|
|
1153
|
-
that messages use a URL-safe encoding.
|
|
212
|
+
* Improve error messages of `assert_changes` and `assert_no_changes`.
|
|
1154
213
|
|
|
1155
|
-
|
|
214
|
+
`assert_changes` error messages now display objects with `.inspect` to make it easier
|
|
215
|
+
to differentiate nil from empty strings, strings from symbols, etc.
|
|
216
|
+
`assert_no_changes` error messages now surface the actual value.
|
|
1156
217
|
|
|
1157
|
-
*
|
|
218
|
+
*pcreux*
|
|
1158
219
|
|
|
1159
|
-
|
|
1160
|
-
It can generate URL-safe strings by passing `url_safe: true`.
|
|
1161
|
-
|
|
1162
|
-
```ruby
|
|
1163
|
-
verifier = ActiveSupport::MessageVerifier.new(url_safe: true)
|
|
1164
|
-
message = verifier.generate(data) # => URL-safe string
|
|
1165
|
-
```
|
|
220
|
+
* Fix `#to_fs(:human_size)` to correctly work with negative numbers.
|
|
1166
221
|
|
|
1167
|
-
|
|
222
|
+
*Earlopain*
|
|
1168
223
|
|
|
1169
|
-
|
|
224
|
+
* Fix `BroadcastLogger#dup` so that it duplicates the logger's `broadcasts`.
|
|
1170
225
|
|
|
1171
|
-
*
|
|
226
|
+
*Andrew Novoselac*
|
|
1172
227
|
|
|
1173
|
-
|
|
228
|
+
* Fix issue where `bootstrap.rb` overwrites the `level` of a `BroadcastLogger`'s `broadcasts`.
|
|
1174
229
|
|
|
1175
|
-
|
|
1176
|
-
config.cache_store = :mem_cache_store, "cache.example.com", pool: false
|
|
1177
|
-
```
|
|
230
|
+
*Andrew Novoselac*
|
|
1178
231
|
|
|
1179
|
-
|
|
232
|
+
* Fix compatibility with the `semantic_logger` gem.
|
|
1180
233
|
|
|
1181
|
-
|
|
234
|
+
The `semantic_logger` gem doesn't behave exactly like stdlib logger in that
|
|
235
|
+
`SemanticLogger#level` returns a Symbol while stdlib `Logger#level` returns an Integer.
|
|
1182
236
|
|
|
1183
|
-
|
|
237
|
+
This caused the various `LogSubscriber` classes in Rails to break when assigned a
|
|
238
|
+
`SemanticLogger` instance.
|
|
1184
239
|
|
|
1185
|
-
*
|
|
240
|
+
*Jean Boussier*, *ojab*
|
|
1186
241
|
|
|
1187
|
-
|
|
242
|
+
* Fix MemoryStore to prevent race conditions when incrementing or decrementing.
|
|
1188
243
|
|
|
1189
|
-
|
|
1190
|
-
config.cache_store = :redis_cache_store, pool: true
|
|
1191
|
-
```
|
|
244
|
+
*Pierre Jambet*
|
|
1192
245
|
|
|
1193
|
-
|
|
246
|
+
* Implement `HashWithIndifferentAccess#to_proc`.
|
|
1194
247
|
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
```
|
|
248
|
+
Previously, calling `#to_proc` on `HashWithIndifferentAccess` object used inherited `#to_proc`
|
|
249
|
+
method from the `Hash` class, which was not able to access values using indifferent keys.
|
|
1198
250
|
|
|
1199
251
|
*fatkodima*
|
|
1200
252
|
|
|
1201
|
-
|
|
1202
|
-
subclasses to set new values.
|
|
1203
|
-
|
|
1204
|
-
Previously incrementing or decrementing an unset key would fail and return
|
|
1205
|
-
nil. A default will now be assumed and the key will be created.
|
|
1206
|
-
|
|
1207
|
-
*Andrej Blagojević*, *Eugene Kenny*
|
|
1208
|
-
|
|
1209
|
-
* Add `skip_nil:` support to `RedisCacheStore`
|
|
1210
|
-
|
|
1211
|
-
*Joey Paris*
|
|
1212
|
-
|
|
1213
|
-
* `ActiveSupport::Cache::MemoryStore#write(name, val, unless_exist:true)` now
|
|
1214
|
-
correctly writes expired keys.
|
|
1215
|
-
|
|
1216
|
-
*Alan Savage*
|
|
1217
|
-
|
|
1218
|
-
* `ActiveSupport::ErrorReporter` now accepts and forward a `source:` parameter.
|
|
1219
|
-
|
|
1220
|
-
This allow libraries to signal the origin of the errors, and reporters
|
|
1221
|
-
to easily ignore some sources.
|
|
1222
|
-
|
|
1223
|
-
*Jean Boussier*
|
|
1224
|
-
|
|
1225
|
-
* Fix and add protections for XSS in `ActionView::Helpers` and `ERB::Util`.
|
|
1226
|
-
|
|
1227
|
-
Add the method `ERB::Util.xml_name_escape` to escape dangerous characters
|
|
1228
|
-
in names of tags and names of attributes, following the specification of XML.
|
|
1229
|
-
|
|
1230
|
-
*Álvaro Martín Fraguas*
|
|
1231
|
-
|
|
1232
|
-
* Respect `ActiveSupport::Logger.new`'s `:formatter` keyword argument
|
|
1233
|
-
|
|
1234
|
-
The stdlib `Logger::new` allows passing a `:formatter` keyword argument to
|
|
1235
|
-
set the logger's formatter. Previously `ActiveSupport::Logger.new` ignored
|
|
1236
|
-
that argument by always setting the formatter to an instance of
|
|
1237
|
-
`ActiveSupport::Logger::SimpleFormatter`.
|
|
1238
|
-
|
|
1239
|
-
*Steven Harman*
|
|
1240
|
-
|
|
1241
|
-
* Deprecate preserving the pre-Ruby 2.4 behavior of `to_time`
|
|
1242
|
-
|
|
1243
|
-
With Ruby 2.4+ the default for +to_time+ changed from converting to the
|
|
1244
|
-
local system time to preserving the offset of the receiver. At the time Rails
|
|
1245
|
-
supported older versions of Ruby so a compatibility layer was added to assist
|
|
1246
|
-
in the migration process. From Rails 5.0 new applications have defaulted to
|
|
1247
|
-
the Ruby 2.4+ behavior and since Rails 7.0 now only supports Ruby 2.7+
|
|
1248
|
-
this compatibility layer can be safely removed.
|
|
1249
|
-
|
|
1250
|
-
To minimize any noise generated the deprecation warning only appears when the
|
|
1251
|
-
setting is configured to `false` as that is the only scenario where the
|
|
1252
|
-
removal of the compatibility layer has any effect.
|
|
1253
|
-
|
|
1254
|
-
*Andrew White*
|
|
1255
|
-
|
|
1256
|
-
* `Pathname.blank?` only returns true for `Pathname.new("")`
|
|
1257
|
-
|
|
1258
|
-
Previously it would end up calling `Pathname#empty?` which returned true
|
|
1259
|
-
if the path existed and was an empty directory or file.
|
|
1260
|
-
|
|
1261
|
-
That behavior was unlikely to be expected.
|
|
1262
|
-
|
|
1263
|
-
*Jean Boussier*
|
|
1264
|
-
|
|
1265
|
-
* Deprecate `Notification::Event`'s `#children` and `#parent_of?`
|
|
1266
|
-
|
|
1267
|
-
*John Hawthorn*
|
|
1268
|
-
|
|
1269
|
-
* Change the default serializer of `ActiveSupport::MessageVerifier` from
|
|
1270
|
-
`Marshal` to `ActiveSupport::JSON` when using `config.load_defaults 7.1`.
|
|
1271
|
-
|
|
1272
|
-
Messages serialized with `Marshal` can still be read, but new messages will
|
|
1273
|
-
be serialized with `ActiveSupport::JSON`. For more information, see
|
|
1274
|
-
https://guides.rubyonrails.org/v7.1/configuring.html#config-active-support-message-serializer.
|
|
1275
|
-
|
|
1276
|
-
*Saba Kiaei*, *David Buckley*, and *Jonathan Hefner*
|
|
1277
|
-
|
|
1278
|
-
* Change the default serializer of `ActiveSupport::MessageEncryptor` from
|
|
1279
|
-
`Marshal` to `ActiveSupport::JSON` when using `config.load_defaults 7.1`.
|
|
1280
|
-
|
|
1281
|
-
Messages serialized with `Marshal` can still be read, but new messages will
|
|
1282
|
-
be serialized with `ActiveSupport::JSON`. For more information, see
|
|
1283
|
-
https://guides.rubyonrails.org/v7.1/configuring.html#config-active-support-message-serializer.
|
|
1284
|
-
|
|
1285
|
-
*Zack Deveau*, *Martin Gingras*, and *Jonathan Hefner*
|
|
1286
|
-
|
|
1287
|
-
* Add `ActiveSupport::TestCase#stub_const` to stub a constant for the duration of a yield.
|
|
1288
|
-
|
|
1289
|
-
*DHH*
|
|
1290
|
-
|
|
1291
|
-
* Fix `ActiveSupport::EncryptedConfiguration` to be compatible with Psych 4
|
|
1292
|
-
|
|
1293
|
-
*Stephen Sugden*
|
|
1294
|
-
|
|
1295
|
-
* Improve `File.atomic_write` error handling
|
|
1296
|
-
|
|
1297
|
-
*Daniel Pepper*
|
|
1298
|
-
|
|
1299
|
-
* Fix `Class#descendants` and `DescendantsTracker#descendants` compatibility with Ruby 3.1.
|
|
1300
|
-
|
|
1301
|
-
[The native `Class#descendants` was reverted prior to Ruby 3.1 release](https://bugs.ruby-lang.org/issues/14394#note-33),
|
|
1302
|
-
but `Class#subclasses` was kept, breaking the feature detection.
|
|
1303
|
-
|
|
1304
|
-
*Jean Boussier*
|
|
1305
|
-
|
|
1306
|
-
Please check [7-0-stable](https://github.com/rails/rails/blob/7-0-stable/activesupport/CHANGELOG.md) for previous changes.
|
|
253
|
+
Please check [7-1-stable](https://github.com/rails/rails/blob/7-1-stable/activesupport/CHANGELOG.md) for previous changes.
|