activesupport 7.2.2.2 → 8.0.3

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.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +182 -162
  3. data/README.rdoc +1 -1
  4. data/lib/active_support/backtrace_cleaner.rb +2 -2
  5. data/lib/active_support/benchmark.rb +21 -0
  6. data/lib/active_support/benchmarkable.rb +3 -2
  7. data/lib/active_support/broadcast_logger.rb +61 -74
  8. data/lib/active_support/cache/file_store.rb +14 -4
  9. data/lib/active_support/cache/mem_cache_store.rb +13 -15
  10. data/lib/active_support/cache/memory_store.rb +9 -5
  11. data/lib/active_support/cache/null_store.rb +2 -2
  12. data/lib/active_support/cache/redis_cache_store.rb +6 -3
  13. data/lib/active_support/cache/strategy/local_cache.rb +56 -20
  14. data/lib/active_support/cache.rb +19 -14
  15. data/lib/active_support/callbacks.rb +8 -5
  16. data/lib/active_support/class_attribute.rb +33 -0
  17. data/lib/active_support/code_generator.rb +9 -0
  18. data/lib/active_support/concurrency/share_lock.rb +0 -1
  19. data/lib/active_support/configuration_file.rb +15 -6
  20. data/lib/active_support/core_ext/array/conversions.rb +3 -3
  21. data/lib/active_support/core_ext/benchmark.rb +7 -9
  22. data/lib/active_support/core_ext/class/attribute.rb +24 -20
  23. data/lib/active_support/core_ext/date/conversions.rb +2 -0
  24. data/lib/active_support/core_ext/date_and_time/compatibility.rb +2 -2
  25. data/lib/active_support/core_ext/date_time/conversions.rb +4 -2
  26. data/lib/active_support/core_ext/enumerable.rb +25 -8
  27. data/lib/active_support/core_ext/erb/util.rb +2 -2
  28. data/lib/active_support/core_ext/hash/deep_merge.rb +1 -0
  29. data/lib/active_support/core_ext/hash/except.rb +0 -12
  30. data/lib/active_support/core_ext/module/attr_internal.rb +3 -4
  31. data/lib/active_support/core_ext/module/introspection.rb +3 -0
  32. data/lib/active_support/core_ext/object/json.rb +15 -9
  33. data/lib/active_support/core_ext/object/to_query.rb +2 -1
  34. data/lib/active_support/core_ext/object/try.rb +2 -2
  35. data/lib/active_support/core_ext/range/overlap.rb +3 -3
  36. data/lib/active_support/core_ext/range/sole.rb +17 -0
  37. data/lib/active_support/core_ext/range.rb +1 -0
  38. data/lib/active_support/core_ext/securerandom.rb +24 -8
  39. data/lib/active_support/core_ext/string/filters.rb +3 -3
  40. data/lib/active_support/core_ext/string/multibyte.rb +2 -2
  41. data/lib/active_support/core_ext/thread/backtrace/location.rb +2 -7
  42. data/lib/active_support/core_ext/time/calculations.rb +14 -2
  43. data/lib/active_support/core_ext/time/compatibility.rb +9 -1
  44. data/lib/active_support/core_ext/time/conversions.rb +2 -0
  45. data/lib/active_support/current_attributes.rb +14 -7
  46. data/lib/active_support/delegation.rb +0 -2
  47. data/lib/active_support/dependencies.rb +0 -1
  48. data/lib/active_support/deprecation/reporting.rb +0 -19
  49. data/lib/active_support/deprecation.rb +1 -1
  50. data/lib/active_support/duration.rb +14 -10
  51. data/lib/active_support/encrypted_configuration.rb +20 -2
  52. data/lib/active_support/error_reporter.rb +36 -3
  53. data/lib/active_support/evented_file_update_checker.rb +0 -1
  54. data/lib/active_support/execution_wrapper.rb +1 -1
  55. data/lib/active_support/file_update_checker.rb +1 -1
  56. data/lib/active_support/gem_version.rb +4 -4
  57. data/lib/active_support/hash_with_indifferent_access.rb +34 -31
  58. data/lib/active_support/i18n_railtie.rb +19 -11
  59. data/lib/active_support/isolated_execution_state.rb +0 -2
  60. data/lib/active_support/json/decoding.rb +4 -2
  61. data/lib/active_support/json/encoding.rb +25 -7
  62. data/lib/active_support/lazy_load_hooks.rb +1 -1
  63. data/lib/active_support/logger_thread_safe_level.rb +6 -3
  64. data/lib/active_support/message_encryptors.rb +2 -2
  65. data/lib/active_support/message_verifier.rb +9 -0
  66. data/lib/active_support/message_verifiers.rb +5 -3
  67. data/lib/active_support/messages/rotator.rb +5 -0
  68. data/lib/active_support/multibyte/chars.rb +4 -1
  69. data/lib/active_support/notifications/fanout.rb +0 -1
  70. data/lib/active_support/number_helper.rb +22 -0
  71. data/lib/active_support/railtie.rb +6 -0
  72. data/lib/active_support/tagged_logging.rb +5 -0
  73. data/lib/active_support/testing/assertions.rb +79 -21
  74. data/lib/active_support/testing/isolation.rb +0 -2
  75. data/lib/active_support/testing/time_helpers.rb +2 -1
  76. data/lib/active_support/time_with_zone.rb +22 -13
  77. data/lib/active_support/values/time_zone.rb +11 -9
  78. data/lib/active_support.rb +10 -3
  79. metadata +22 -7
  80. data/lib/active_support/proxy_object.rb +0 -20
  81. 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: 750ecfba98f84e525b7c36607c041c383a1a549a4066b99eff3b54cb7f6aea17
4
- data.tar.gz: 541657fdd905365f97f377d67b2cbd3f0849e6d94281bfe6da4625a09226167d
3
+ metadata.gz: b2cdf9736ba5b94841913f95e5e83f01cc82becad9006ed2d75e18f1cc117c43
4
+ data.tar.gz: 7f8f545780e7ecfece1bdd6af006e504d91e89ad019a1020cd43014a296e7def
5
5
  SHA512:
6
- metadata.gz: c3af2c496e771d723aca4f73c5d11fde1b163a975fd0652de23ef91896615af158b804e8754bf5483b2946333051c8fb0a31aacf6f13d5a314b9a8815e1cdb3c
7
- data.tar.gz: 3242b4bc37eb068eb09c191d5f4feec156dc21e565b4a9372068c22828e1c84e80fb847e04b85a7521af018ba543ba9a20e0fae25bcb9e03e83b123ec9ecd8c0
6
+ metadata.gz: b23ff4bae6aae8f2e154b478c8f36825d0179152a0591591c240ea2b8d6104dcad0b70598a9b42888ab41448a06bc6b69c4ca537c1e5edb386fa81408f25acde
7
+ data.tar.gz: 84fa236c5c86feff0ae2283888ca7266c5f5d9090474b099c2b9142c082e107062bea571d8197f0138a022d7db7fe08e02f3544ade6cd611de68c35b26b90e75
data/CHANGELOG.md CHANGED
@@ -1,289 +1,309 @@
1
- ## Rails 7.2.2.2 (August 13, 2025) ##
1
+ ## Rails 8.0.3 (September 22, 2025) ##
2
2
 
3
- * No changes.
3
+ * `ActiveSupport::FileUpdateChecker` does not depend on `Time.now` to prevent unnecessary reloads with time travel test helpers
4
4
 
5
+ *Jan Grodowski*
5
6
 
6
- ## Rails 7.2.2.1 (December 10, 2024) ##
7
+ * Fix `ActiveSupport::BroadcastLogger` from executing a block argument for each logger (tagged, info, etc.).
7
8
 
8
- * No changes.
9
+ *Jared Armstrong*
9
10
 
11
+ * Make `ActiveSupport::Logger` `#freeze`-friendly.
10
12
 
11
- ## Rails 7.2.2 (October 30, 2024) ##
13
+ *Joshua Young*
12
14
 
13
- * Include options when instrumenting `ActiveSupport::Cache::Store#delete` and `ActiveSupport::Cache::Store#delete_multi`.
15
+ * Fix `ActiveSupport::HashWithIndifferentAccess#transform_keys!` removing defaults.
14
16
 
15
- *Adam Renberg Tamm*
17
+ *Hartley McGuire*
16
18
 
17
- * Print test names when running `rails test -v` for parallel tests.
19
+ * Fix `ActiveSupport::HashWithIndifferentAccess#tranform_keys!` to handle collisions.
18
20
 
19
- *John Hawthorn*, *Abeid Ahmed*
21
+ If the transformation would result in a key equal to another not yet transformed one,
22
+ it would result in keys being lost.
20
23
 
24
+ Before:
21
25
 
22
- ## Rails 7.2.1.2 (October 23, 2024) ##
26
+ ```ruby
27
+ >> {a: 1, b: 2}.with_indifferent_access.transform_keys!(&:succ)
28
+ => {"c" => 1}
29
+ ```
23
30
 
24
- * No changes.
31
+ After:
25
32
 
33
+ ```ruby
34
+ >> {a: 1, b: 2}.with_indifferent_access.transform_keys!(&:succ)
35
+ => {"c" => 1, "d" => 2}
36
+ ```
26
37
 
27
- ## Rails 7.2.1.1 (October 15, 2024) ##
38
+ *Jason T Johnson*, *Jean Boussier*
28
39
 
29
- * No changes.
40
+ * Fix `ActiveSupport::Cache::MemCacheStore#read_multi` to handle network errors.
30
41
 
42
+ This method specifically wasn't handling network errors like other codepaths.
31
43
 
32
- ## Rails 7.2.1 (August 22, 2024) ##
44
+ *Alessandro Dal Grande*
45
+
46
+ * Fix configuring `RedisCacheStore` with `raw: true`.
47
+
48
+ *fatkodima*
49
+
50
+ * Fix `Enumerable#sole` for infinite collections.
51
+
52
+ *fatkodima*
53
+
54
+
55
+ ## Rails 8.0.2.1 (August 13, 2025) ##
33
56
 
34
57
  * No changes.
35
58
 
36
59
 
37
- ## Rails 7.2.0 (August 09, 2024) ##
60
+ ## Rails 8.0.2 (March 12, 2025) ##
38
61
 
39
- * Fix `delegate_missing_to allow_nil: true` when called with implict self
62
+ * Fix setting `to_time_preserves_timezone` from `new_framework_defaults_8_0.rb`.
40
63
 
41
- ```ruby
42
- class Person
43
- delegate_missing_to :address, allow_nil: true
64
+ *fatkodima*
44
65
 
45
- def address
46
- nil
47
- end
66
+ * Fix Active Support Cache `fetch_multi` when local store is active.
48
67
 
49
- def berliner?
50
- city == "Berlin"
51
- end
52
- end
68
+ `fetch_multi` now properly yield to the provided block for missing entries
69
+ that have been recorded as such in the local store.
53
70
 
54
- Person.new.city # => nil
55
- Person.new.berliner? # undefined local variable or method `city' for an instance of Person (NameError)
56
- ```
71
+ *Jean Boussier*
72
+
73
+ * Fix execution wrapping to report all exceptions, including `Exception`.
74
+
75
+ If a more serious error like `SystemStackError` or `NoMemoryError` happens,
76
+ the error reporter should be able to report these kinds of exceptions.
77
+
78
+ *Gannon McGibbon*
79
+
80
+ * Fix `RedisCacheStore` and `MemCacheStore` to also handle connection pool related errors.
81
+
82
+ These errors are rescued and reported to `Rails.error`.
57
83
 
58
84
  *Jean Boussier*
59
85
 
60
- * Add `logger` as a dependency since it is a bundled gem candidate for Ruby 3.5
86
+ * Fix `ActiveSupport::Cache#read_multi` to respect version expiry when using local cache.
61
87
 
62
- *Earlopain*
88
+ *zzak*
63
89
 
64
- * Define `Digest::UUID.nil_uuid`, which returns the so-called nil UUID.
90
+ * Fix `ActiveSupport::MessageVerifier` and `ActiveSupport::MessageEncryptor` configuration of `on_rotation` callback.
65
91
 
66
- *Xavier Noria*
92
+ ```ruby
93
+ verifier.rotate(old_secret).on_rotation { ... }
94
+ ```
67
95
 
68
- * Support `duration` type in `ActiveSupport::XmlMini`.
96
+ Now both work as documented.
69
97
 
70
- *heka1024*
98
+ *Jean Boussier*
71
99
 
72
- * Remove deprecated `ActiveSupport::Notifications::Event#children` and `ActiveSupport::Notifications::Event#parent_of?`.
100
+ * Fix `ActiveSupport::MessageVerifier` to always be able to verify both URL-safe and URL-unsafe payloads.
73
101
 
74
- *Rafael Mendonça França*
102
+ This is to allow transitioning seemlessly from either configuration without immediately invalidating
103
+ all previously generated signed messages.
75
104
 
76
- * Remove deprecated support to call the following methods without passing a deprecator:
105
+ *Jean Boussier*, *Florent Beaurain*, *Ali Sepehri*
77
106
 
78
- - `deprecate`
79
- - `deprecate_constant`
80
- - `ActiveSupport::Deprecation::DeprecatedObjectProxy.new`
81
- - `ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.new`
82
- - `ActiveSupport::Deprecation::DeprecatedConstantProxy.new`
83
- - `assert_deprecated`
84
- - `assert_not_deprecated`
85
- - `collect_deprecations`
107
+ * Fix `cache.fetch` to honor the provided expiry when `:race_condition_ttl` is used.
86
108
 
87
- *Rafael Mendonça França*
109
+ ```ruby
110
+ cache.fetch("key", expires_in: 1.hour, race_condition_ttl: 5.second) do
111
+ "something"
112
+ end
113
+ ```
88
114
 
89
- * Remove deprecated `ActiveSupport::Deprecation` delegation to instance.
115
+ In the above example, the final cache entry would have a 10 seconds TTL instead
116
+ of the requested 1 hour.
90
117
 
91
- *Rafael Mendonça França*
118
+ *Dhia*
92
119
 
93
- * Remove deprecated `SafeBuffer#clone_empty`.
120
+ * Better handle procs with splat arguments in `set_callback`.
94
121
 
95
- *Rafael Mendonça França*
122
+ *Radamés Roriz*
96
123
 
97
- * Remove deprecated `#to_default_s` from `Array`, `Date`, `DateTime` and `Time`.
124
+ * Fix `String#mb_chars` to not mutate the receiver.
98
125
 
99
- *Rafael Mendonça França*
126
+ Previously it would call `force_encoding` on the receiver,
127
+ now it dups the receiver first.
100
128
 
101
- * Remove deprecated support to passing `Dalli::Client` instances to `MemCacheStore`.
129
+ *Jean Boussier*
102
130
 
103
- *Rafael Mendonça França*
131
+ * Improve `ErrorSubscriber` to also mark error causes as reported.
104
132
 
105
- * Remove deprecated `config.active_support.use_rfc4122_namespaced_uuids`.
133
+ This avoid some cases of errors being reported twice, notably in views because of how
134
+ errors are wrapped in `ActionView::Template::Error`.
106
135
 
107
- *Rafael Mendonça França*
136
+ *Jean Boussier*
108
137
 
109
- * Remove deprecated `config.active_support.remove_deprecated_time_with_zone_name`.
138
+ * Fix `Module#module_parent_name` to return the correct name after the module has been named.
110
139
 
111
- *Rafael Mendonça França*
140
+ When called on an anonymous module, the return value wouldn't change after the module was given a name
141
+ later by being assigned to a constant.
112
142
 
113
- * Remove deprecated `config.active_support.disable_to_s_conversion`.
143
+ ```ruby
144
+ mod = Module.new
145
+ mod.module_parent_name # => "Object"
146
+ MyModule::Something = mod
147
+ mod.module_parent_name # => "MyModule"
148
+ ```
114
149
 
115
- *Rafael Mendonça França*
150
+ *Jean Boussier*
116
151
 
117
- * Remove deprecated support to bolding log text with positional boolean in `ActiveSupport::LogSubscriber#color`.
118
152
 
119
- *Rafael Mendonça França*
153
+ ## Rails 8.0.1 (December 13, 2024) ##
120
154
 
121
- * Remove deprecated constants `ActiveSupport::LogSubscriber::CLEAR` and `ActiveSupport::LogSubscriber::BOLD`.
155
+ * Fix a bug in `ERB::Util.tokenize` that causes incorrect tokenization when ERB tags are preceeded by multibyte characters.
122
156
 
123
- *Rafael Mendonça França*
157
+ *Martin Emde*
124
158
 
125
- * Remove deprecated support for `config.active_support.cache_format_version = 6.1`.
159
+ * Restore the ability to decorate methods generated by `class_attribute`.
126
160
 
127
- *Rafael Mendonça França*
161
+ It always has been complicated to use Module#prepend or an alias method chain
162
+ to decorate methods defined by `class_attribute`, but became even harder in 8.0.
128
163
 
129
- * Remove deprecated `:pool_size` and `:pool_timeout` options for the cache storage.
164
+ This capability is now supported for both reader and writer methods.
130
165
 
131
- *Rafael Mendonça França*
166
+ *Jean Boussier*
132
167
 
133
- * Warn on tests without assertions.
134
168
 
135
- `ActiveSupport::TestCase` now warns when tests do not run any assertions.
136
- This is helpful in detecting broken tests that do not perform intended assertions.
169
+ ## Rails 8.0.0.1 (December 10, 2024) ##
137
170
 
138
- *fatkodima*
171
+ * No changes.
139
172
 
140
- * Support `hexBinary` type in `ActiveSupport::XmlMini`.
141
173
 
142
- *heka1024*
174
+ ## Rails 8.0.0 (November 07, 2024) ##
143
175
 
144
- * Deprecate `ActiveSupport::ProxyObject` in favor of Ruby's built-in `BasicObject`.
176
+ * No changes.
145
177
 
146
- *Earlopain*
147
178
 
148
- * `stub_const` now accepts a `exists: false` parameter to allow stubbing missing constants.
179
+ ## Rails 8.0.0.rc2 (October 30, 2024) ##
149
180
 
150
- *Jean Boussier*
181
+ * No changes.
151
182
 
152
- * Make `ActiveSupport::BacktraceCleaner` copy filters and silencers on dup and clone.
153
183
 
154
- Previously the copy would still share the internal silencers and filters array,
155
- causing state to leak.
184
+ ## Rails 8.0.0.rc1 (October 19, 2024) ##
156
185
 
157
- *Jean Boussier*
186
+ * Remove deprecated support to passing an array of strings to `ActiveSupport::Deprecation#warn`.
158
187
 
159
- * Updating Astana with Western Kazakhstan TZInfo identifier.
188
+ *Rafael Mendonça França*
160
189
 
161
- *Damian Nelson*
190
+ * Remove deprecated support to setting `attr_internal_naming_format` with a `@` prefix.
162
191
 
163
- * Add filename support for `ActiveSupport::Logger.logger_outputs_to?`.
192
+ *Rafael Mendonça França*
164
193
 
165
- ```ruby
166
- logger = Logger.new('/var/log/rails.log')
167
- ActiveSupport::Logger.logger_outputs_to?(logger, '/var/log/rails.log')
168
- ```
194
+ * Remove deprecated `ActiveSupport::ProxyObject`.
169
195
 
170
- *Christian Schmidt*
196
+ *Rafael Mendonça França*
171
197
 
172
- * Include `IPAddr#prefix` when serializing an `IPAddr` using the
173
- `ActiveSupport::MessagePack` serializer.
198
+ * Don't execute i18n watcher on boot. It shouldn't catch any file changes initially,
199
+ and unnecessarily slows down boot of applications with lots of translations.
174
200
 
175
- This change is backward and forward compatible — old payloads can
176
- still be read, and new payloads will be readable by older versions of Rails.
201
+ *Gannon McGibbon*, *David Stosik*
177
202
 
178
- *Taiki Komaba*
203
+ * Fix `ActiveSupport::HashWithIndifferentAccess#stringify_keys` to stringify all keys not just symbols.
179
204
 
180
- * Add `default:` support for `ActiveSupport::CurrentAttributes.attribute`.
205
+ Previously:
181
206
 
182
207
  ```ruby
183
- class Current < ActiveSupport::CurrentAttributes
184
- attribute :counter, default: 0
185
- end
208
+ { 1 => 2 }.with_indifferent_access.stringify_keys[1] # => 2
186
209
  ```
187
210
 
188
- *Sean Doyle*
189
-
190
- * Yield instance to `Object#with` block.
211
+ After this change:
191
212
 
192
213
  ```ruby
193
- client.with(timeout: 5_000) do |c|
194
- c.get("/commits")
195
- end
214
+ { 1 => 2 }.with_indifferent_access.stringify_keys["1"] # => 2
196
215
  ```
197
216
 
198
- *Sean Doyle*
217
+ This change can be seen as a bug fix, but since it behaved like this for a very long time, we're deciding
218
+ to not backport the fix and to make the change in a major release.
199
219
 
200
- * Use logical core count instead of physical core count to determine the
201
- default number of workers when parallelizing tests.
220
+ *Jean Boussier*
202
221
 
203
- *Jonathan Hefner*
222
+ ## Rails 8.0.0.beta1 (September 26, 2024) ##
204
223
 
205
- * Fix `Time.now/DateTime.now/Date.today` to return results in a system timezone after `#travel_to`.
224
+ * Include options when instrumenting `ActiveSupport::Cache::Store#delete` and `ActiveSupport::Cache::Store#delete_multi`.
206
225
 
207
- There is a bug in the current implementation of #travel_to:
208
- it remembers a timezone of its argument, and all stubbed methods start
209
- returning results in that remembered timezone. However, the expected
210
- behavior is to return results in a system timezone.
226
+ *Adam Renberg Tamm*
211
227
 
212
- *Aleksei Chernenkov*
228
+ * Print test names when running `rails test -v` for parallel tests.
213
229
 
214
- * Add `ErrorReported#unexpected` to report precondition violations.
230
+ *John Hawthorn*, *Abeid Ahmed*
215
231
 
216
- For example:
232
+ * Deprecate `Benchmark.ms` core extension.
217
233
 
218
- ```ruby
219
- def edit
220
- if published?
221
- Rails.error.unexpected("[BUG] Attempting to edit a published article, that shouldn't be possible")
222
- return false
223
- end
224
- # ...
225
- end
226
- ```
234
+ The `benchmark` gem will become bundled in Ruby 3.5
227
235
 
228
- The above will raise an error in development and test, but only report the error in production.
236
+ *Earlopain*
229
237
 
230
- *Jean Boussier*
238
+ * `ActiveSupport::TimeWithZone#inspect` now uses ISO 8601 style time like `Time#inspect`
231
239
 
232
- * Make the order of read_multi and write_multi notifications for `Cache::Store#fetch_multi` operations match the order they are executed in.
240
+ *John Hawthorn*
233
241
 
234
- *Adam Renberg Tamm*
242
+ * `ActiveSupport::ErrorReporter#report` now assigns a backtrace to unraised exceptions.
235
243
 
236
- * Make return values of `Cache::Store#write` consistent.
244
+ Previously reporting an un-raised exception would result in an error report without
245
+ a backtrace. Now it automatically generates one.
237
246
 
238
- The return value was not specified before. Now it returns `true` on a successful write,
239
- `nil` if there was an error talking to the cache backend, and `false` if the write failed
240
- for another reason (e.g. the key already exists and `unless_exist: true` was passed).
247
+ *Jean Boussier*
241
248
 
242
- *Sander Verdonschot*
249
+ * Add `escape_html_entities` option to `ActiveSupport::JSON.encode`.
243
250
 
244
- * Fix logged cache keys not always matching actual key used by cache action.
251
+ This allows for overriding the global configuration found at
252
+ `ActiveSupport.escape_html_entities_in_json` for specific calls to `to_json`.
245
253
 
246
- *Hartley McGuire*
254
+ This should be usable from controllers in the following manner:
255
+ ```ruby
256
+ class MyController < ApplicationController
257
+ def index
258
+ render json: { hello: "world" }, escape_html_entities: false
259
+ end
260
+ end
261
+ ```
247
262
 
248
- * Improve error messages of `assert_changes` and `assert_no_changes`.
263
+ *Nigel Baillie*
249
264
 
250
- `assert_changes` error messages now display objects with `.inspect` to make it easier
251
- to differentiate nil from empty strings, strings from symbols, etc.
252
- `assert_no_changes` error messages now surface the actual value.
265
+ * Raise when using key which can't respond to `#to_sym` in `EncryptedConfiguration`.
253
266
 
254
- *pcreux*
267
+ As is the case when trying to use an Integer or Float as a key, which is unsupported.
255
268
 
256
- * Fix `#to_fs(:human_size)` to correctly work with negative numbers.
269
+ *zzak*
257
270
 
258
- *Earlopain*
271
+ * Deprecate addition and since between two `Time` and `ActiveSupport::TimeWithZone`.
259
272
 
260
- * Fix `BroadcastLogger#dup` so that it duplicates the logger's `broadcasts`.
273
+ 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.
261
274
 
262
- *Andrew Novoselac*
275
+ *Nick Schwaderer*
263
276
 
264
- * Fix issue where `bootstrap.rb` overwrites the `level` of a `BroadcastLogger`'s `broadcasts`.
277
+ * Support rfc2822 format for Time#to_fs & Date#to_fs.
265
278
 
266
- *Andrew Novoselac*
279
+ *Akshay Birajdar*
267
280
 
268
- * Fix compatibility with the `semantic_logger` gem.
281
+ * Optimize load time for `Railtie#initialize_i18n`. Filter `I18n.load_path`s passed to the file watcher to only those
282
+ under `Rails.root`. Previously the watcher would grab all available locales, including those in gems
283
+ which do not require a watcher because they won't change.
269
284
 
270
- The `semantic_logger` gem doesn't behave exactly like stdlib logger in that
271
- `SemanticLogger#level` returns a Symbol while stdlib `Logger#level` returns an Integer.
285
+ *Nick Schwaderer*
272
286
 
273
- This caused the various `LogSubscriber` classes in Rails to break when assigned a
274
- `SemanticLogger` instance.
287
+ * Add a `filter` option to `in_order_of` to prioritize certain values in the sorting without filtering the results
288
+ by these values.
275
289
 
276
- *Jean Boussier*, *ojab*
290
+ *Igor Depolli*
277
291
 
278
- * Fix MemoryStore to prevent race conditions when incrementing or decrementing.
292
+ * Improve error message when using `assert_difference` or `assert_changes` with a
293
+ proc by printing the proc's source code (MRI only).
279
294
 
280
- *Pierre Jambet*
295
+ *Richard Böhme*, *Jean Boussier*
281
296
 
282
- * Implement `HashWithIndifferentAccess#to_proc`.
297
+ * 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`.
283
298
 
284
- Previously, calling `#to_proc` on `HashWithIndifferentAccess` object used inherited `#to_proc`
285
- method from the `Hash` class, which was not able to access values using indifferent keys.
299
+ *Jason Kim*, *John Hawthorn*
286
300
 
287
- *fatkodima*
301
+ * Align instrumentation `payload[:key]` in ActiveSupport::Cache to follow the same pattern, with namespaced and normalized keys.
302
+
303
+ *Frederik Erbs Spang Thomsen*
304
+
305
+ * Fix `travel_to` to set usec 0 when `with_usec` is `false` and the given argument String or DateTime.
306
+
307
+ *mopp*
288
308
 
289
- Please check [7-1-stable](https://github.com/rails/rails/blob/7-1-stable/activesupport/CHANGELOG.md) for previous changes.
309
+ 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 rails-core mailing list here:
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.start_with?(root) ? line.from(root.size) : line } # strip the Rails.root prefix
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.start_with?(root) ? line.from(root.size) : 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.ms { result = options[:silence] ? logger.silence(&block) : yield }
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