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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +182 -162
- 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 +13 -15
- data/lib/active_support/cache/memory_store.rb +9 -5
- data/lib/active_support/cache/null_store.rb +2 -2
- data/lib/active_support/cache/redis_cache_store.rb +6 -3
- data/lib/active_support/cache/strategy/local_cache.rb +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 +24 -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 +15 -9
- 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/multibyte.rb +2 -2
- 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 +0 -2
- 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/isolated_execution_state.rb +0 -2
- 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_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/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/testing/assertions.rb +79 -21
- data/lib/active_support/testing/isolation.rb +0 -2
- 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.rb +10 -3
- metadata +22 -7
- 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: b2cdf9736ba5b94841913f95e5e83f01cc82becad9006ed2d75e18f1cc117c43
|
|
4
|
+
data.tar.gz: 7f8f545780e7ecfece1bdd6af006e504d91e89ad019a1020cd43014a296e7def
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b23ff4bae6aae8f2e154b478c8f36825d0179152a0591591c240ea2b8d6104dcad0b70598a9b42888ab41448a06bc6b69c4ca537c1e5edb386fa81408f25acde
|
|
7
|
+
data.tar.gz: 84fa236c5c86feff0ae2283888ca7266c5f5d9090474b099c2b9142c082e107062bea571d8197f0138a022d7db7fe08e02f3544ade6cd611de68c35b26b90e75
|
data/CHANGELOG.md
CHANGED
|
@@ -1,289 +1,309 @@
|
|
|
1
|
-
## Rails
|
|
1
|
+
## Rails 8.0.3 (September 22, 2025) ##
|
|
2
2
|
|
|
3
|
-
*
|
|
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
|
-
|
|
7
|
+
* Fix `ActiveSupport::BroadcastLogger` from executing a block argument for each logger (tagged, info, etc.).
|
|
7
8
|
|
|
8
|
-
*
|
|
9
|
+
*Jared Armstrong*
|
|
9
10
|
|
|
11
|
+
* Make `ActiveSupport::Logger` `#freeze`-friendly.
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
*Joshua Young*
|
|
12
14
|
|
|
13
|
-
*
|
|
15
|
+
* Fix `ActiveSupport::HashWithIndifferentAccess#transform_keys!` removing defaults.
|
|
14
16
|
|
|
15
|
-
*
|
|
17
|
+
*Hartley McGuire*
|
|
16
18
|
|
|
17
|
-
*
|
|
19
|
+
* Fix `ActiveSupport::HashWithIndifferentAccess#tranform_keys!` to handle collisions.
|
|
18
20
|
|
|
19
|
-
|
|
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
|
-
|
|
26
|
+
```ruby
|
|
27
|
+
>> {a: 1, b: 2}.with_indifferent_access.transform_keys!(&:succ)
|
|
28
|
+
=> {"c" => 1}
|
|
29
|
+
```
|
|
23
30
|
|
|
24
|
-
|
|
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
|
-
|
|
38
|
+
*Jason T Johnson*, *Jean Boussier*
|
|
28
39
|
|
|
29
|
-
*
|
|
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
|
-
|
|
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
|
|
60
|
+
## Rails 8.0.2 (March 12, 2025) ##
|
|
38
61
|
|
|
39
|
-
* Fix `
|
|
62
|
+
* Fix setting `to_time_preserves_timezone` from `new_framework_defaults_8_0.rb`.
|
|
40
63
|
|
|
41
|
-
|
|
42
|
-
class Person
|
|
43
|
-
delegate_missing_to :address, allow_nil: true
|
|
64
|
+
*fatkodima*
|
|
44
65
|
|
|
45
|
-
|
|
46
|
-
nil
|
|
47
|
-
end
|
|
66
|
+
* Fix Active Support Cache `fetch_multi` when local store is active.
|
|
48
67
|
|
|
49
|
-
|
|
50
|
-
|
|
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
|
-
|
|
55
|
-
|
|
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
|
-
*
|
|
86
|
+
* Fix `ActiveSupport::Cache#read_multi` to respect version expiry when using local cache.
|
|
61
87
|
|
|
62
|
-
*
|
|
88
|
+
*zzak*
|
|
63
89
|
|
|
64
|
-
*
|
|
90
|
+
* Fix `ActiveSupport::MessageVerifier` and `ActiveSupport::MessageEncryptor` configuration of `on_rotation` callback.
|
|
65
91
|
|
|
66
|
-
|
|
92
|
+
```ruby
|
|
93
|
+
verifier.rotate(old_secret).on_rotation { ... }
|
|
94
|
+
```
|
|
67
95
|
|
|
68
|
-
|
|
96
|
+
Now both work as documented.
|
|
69
97
|
|
|
70
|
-
*
|
|
98
|
+
*Jean Boussier*
|
|
71
99
|
|
|
72
|
-
*
|
|
100
|
+
* Fix `ActiveSupport::MessageVerifier` to always be able to verify both URL-safe and URL-unsafe payloads.
|
|
73
101
|
|
|
74
|
-
|
|
102
|
+
This is to allow transitioning seemlessly from either configuration without immediately invalidating
|
|
103
|
+
all previously generated signed messages.
|
|
75
104
|
|
|
76
|
-
*
|
|
105
|
+
*Jean Boussier*, *Florent Beaurain*, *Ali Sepehri*
|
|
77
106
|
|
|
78
|
-
|
|
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
|
-
|
|
109
|
+
```ruby
|
|
110
|
+
cache.fetch("key", expires_in: 1.hour, race_condition_ttl: 5.second) do
|
|
111
|
+
"something"
|
|
112
|
+
end
|
|
113
|
+
```
|
|
88
114
|
|
|
89
|
-
|
|
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
|
-
*
|
|
118
|
+
*Dhia*
|
|
92
119
|
|
|
93
|
-
*
|
|
120
|
+
* Better handle procs with splat arguments in `set_callback`.
|
|
94
121
|
|
|
95
|
-
*
|
|
122
|
+
*Radamés Roriz*
|
|
96
123
|
|
|
97
|
-
*
|
|
124
|
+
* Fix `String#mb_chars` to not mutate the receiver.
|
|
98
125
|
|
|
99
|
-
|
|
126
|
+
Previously it would call `force_encoding` on the receiver,
|
|
127
|
+
now it dups the receiver first.
|
|
100
128
|
|
|
101
|
-
*
|
|
129
|
+
*Jean Boussier*
|
|
102
130
|
|
|
103
|
-
|
|
131
|
+
* Improve `ErrorSubscriber` to also mark error causes as reported.
|
|
104
132
|
|
|
105
|
-
|
|
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
|
-
*
|
|
136
|
+
*Jean Boussier*
|
|
108
137
|
|
|
109
|
-
*
|
|
138
|
+
* Fix `Module#module_parent_name` to return the correct name after the module has been named.
|
|
110
139
|
|
|
111
|
-
|
|
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
|
-
|
|
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
|
-
*
|
|
150
|
+
*Jean Boussier*
|
|
116
151
|
|
|
117
|
-
* Remove deprecated support to bolding log text with positional boolean in `ActiveSupport::LogSubscriber#color`.
|
|
118
152
|
|
|
119
|
-
|
|
153
|
+
## Rails 8.0.1 (December 13, 2024) ##
|
|
120
154
|
|
|
121
|
-
*
|
|
155
|
+
* Fix a bug in `ERB::Util.tokenize` that causes incorrect tokenization when ERB tags are preceeded by multibyte characters.
|
|
122
156
|
|
|
123
|
-
*
|
|
157
|
+
*Martin Emde*
|
|
124
158
|
|
|
125
|
-
*
|
|
159
|
+
* Restore the ability to decorate methods generated by `class_attribute`.
|
|
126
160
|
|
|
127
|
-
|
|
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
|
-
|
|
164
|
+
This capability is now supported for both reader and writer methods.
|
|
130
165
|
|
|
131
|
-
*
|
|
166
|
+
*Jean Boussier*
|
|
132
167
|
|
|
133
|
-
* Warn on tests without assertions.
|
|
134
168
|
|
|
135
|
-
|
|
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
|
-
|
|
171
|
+
* No changes.
|
|
139
172
|
|
|
140
|
-
* Support `hexBinary` type in `ActiveSupport::XmlMini`.
|
|
141
173
|
|
|
142
|
-
|
|
174
|
+
## Rails 8.0.0 (November 07, 2024) ##
|
|
143
175
|
|
|
144
|
-
*
|
|
176
|
+
* No changes.
|
|
145
177
|
|
|
146
|
-
*Earlopain*
|
|
147
178
|
|
|
148
|
-
|
|
179
|
+
## Rails 8.0.0.rc2 (October 30, 2024) ##
|
|
149
180
|
|
|
150
|
-
|
|
181
|
+
* No changes.
|
|
151
182
|
|
|
152
|
-
* Make `ActiveSupport::BacktraceCleaner` copy filters and silencers on dup and clone.
|
|
153
183
|
|
|
154
|
-
|
|
155
|
-
causing state to leak.
|
|
184
|
+
## Rails 8.0.0.rc1 (October 19, 2024) ##
|
|
156
185
|
|
|
157
|
-
|
|
186
|
+
* Remove deprecated support to passing an array of strings to `ActiveSupport::Deprecation#warn`.
|
|
158
187
|
|
|
159
|
-
*
|
|
188
|
+
*Rafael Mendonça França*
|
|
160
189
|
|
|
161
|
-
|
|
190
|
+
* Remove deprecated support to setting `attr_internal_naming_format` with a `@` prefix.
|
|
162
191
|
|
|
163
|
-
*
|
|
192
|
+
*Rafael Mendonça França*
|
|
164
193
|
|
|
165
|
-
|
|
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
|
-
*
|
|
196
|
+
*Rafael Mendonça França*
|
|
171
197
|
|
|
172
|
-
*
|
|
173
|
-
|
|
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
|
-
|
|
176
|
-
still be read, and new payloads will be readable by older versions of Rails.
|
|
201
|
+
*Gannon McGibbon*, *David Stosik*
|
|
177
202
|
|
|
178
|
-
|
|
203
|
+
* Fix `ActiveSupport::HashWithIndifferentAccess#stringify_keys` to stringify all keys not just symbols.
|
|
179
204
|
|
|
180
|
-
|
|
205
|
+
Previously:
|
|
181
206
|
|
|
182
207
|
```ruby
|
|
183
|
-
|
|
184
|
-
attribute :counter, default: 0
|
|
185
|
-
end
|
|
208
|
+
{ 1 => 2 }.with_indifferent_access.stringify_keys[1] # => 2
|
|
186
209
|
```
|
|
187
210
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
* Yield instance to `Object#with` block.
|
|
211
|
+
After this change:
|
|
191
212
|
|
|
192
213
|
```ruby
|
|
193
|
-
|
|
194
|
-
c.get("/commits")
|
|
195
|
-
end
|
|
214
|
+
{ 1 => 2 }.with_indifferent_access.stringify_keys["1"] # => 2
|
|
196
215
|
```
|
|
197
216
|
|
|
198
|
-
|
|
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
|
-
*
|
|
201
|
-
default number of workers when parallelizing tests.
|
|
220
|
+
*Jean Boussier*
|
|
202
221
|
|
|
203
|
-
|
|
222
|
+
## Rails 8.0.0.beta1 (September 26, 2024) ##
|
|
204
223
|
|
|
205
|
-
*
|
|
224
|
+
* Include options when instrumenting `ActiveSupport::Cache::Store#delete` and `ActiveSupport::Cache::Store#delete_multi`.
|
|
206
225
|
|
|
207
|
-
|
|
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
|
-
|
|
228
|
+
* Print test names when running `rails test -v` for parallel tests.
|
|
213
229
|
|
|
214
|
-
*
|
|
230
|
+
*John Hawthorn*, *Abeid Ahmed*
|
|
215
231
|
|
|
216
|
-
|
|
232
|
+
* Deprecate `Benchmark.ms` core extension.
|
|
217
233
|
|
|
218
|
-
|
|
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
|
-
|
|
236
|
+
*Earlopain*
|
|
229
237
|
|
|
230
|
-
|
|
238
|
+
* `ActiveSupport::TimeWithZone#inspect` now uses ISO 8601 style time like `Time#inspect`
|
|
231
239
|
|
|
232
|
-
*
|
|
240
|
+
*John Hawthorn*
|
|
233
241
|
|
|
234
|
-
|
|
242
|
+
* `ActiveSupport::ErrorReporter#report` now assigns a backtrace to unraised exceptions.
|
|
235
243
|
|
|
236
|
-
|
|
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
|
-
|
|
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
|
-
|
|
249
|
+
* Add `escape_html_entities` option to `ActiveSupport::JSON.encode`.
|
|
243
250
|
|
|
244
|
-
|
|
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
|
-
|
|
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
|
-
*
|
|
263
|
+
*Nigel Baillie*
|
|
249
264
|
|
|
250
|
-
|
|
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
|
-
|
|
267
|
+
As is the case when trying to use an Integer or Float as a key, which is unsupported.
|
|
255
268
|
|
|
256
|
-
*
|
|
269
|
+
*zzak*
|
|
257
270
|
|
|
258
|
-
|
|
271
|
+
* Deprecate addition and since between two `Time` and `ActiveSupport::TimeWithZone`.
|
|
259
272
|
|
|
260
|
-
|
|
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
|
-
*
|
|
275
|
+
*Nick Schwaderer*
|
|
263
276
|
|
|
264
|
-
*
|
|
277
|
+
* Support rfc2822 format for Time#to_fs & Date#to_fs.
|
|
265
278
|
|
|
266
|
-
*
|
|
279
|
+
*Akshay Birajdar*
|
|
267
280
|
|
|
268
|
-
*
|
|
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
|
-
|
|
271
|
-
`SemanticLogger#level` returns a Symbol while stdlib `Logger#level` returns an Integer.
|
|
285
|
+
*Nick Schwaderer*
|
|
272
286
|
|
|
273
|
-
|
|
274
|
-
|
|
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
|
-
*
|
|
290
|
+
*Igor Depolli*
|
|
277
291
|
|
|
278
|
-
*
|
|
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
|
-
*
|
|
295
|
+
*Richard Böhme*, *Jean Boussier*
|
|
281
296
|
|
|
282
|
-
*
|
|
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
|
-
|
|
285
|
-
method from the `Hash` class, which was not able to access values using indifferent keys.
|
|
299
|
+
*Jason Kim*, *John Hawthorn*
|
|
286
300
|
|
|
287
|
-
|
|
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-
|
|
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
|
|
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
|