activesupport 6.0.6.1 → 6.1.7.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activesupport might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +423 -466
- data/MIT-LICENSE +1 -1
- data/lib/active_support/array_inquirer.rb +4 -2
- data/lib/active_support/backtrace_cleaner.rb +3 -3
- data/lib/active_support/benchmarkable.rb +1 -1
- data/lib/active_support/cache/file_store.rb +3 -3
- data/lib/active_support/cache/mem_cache_store.rb +28 -18
- data/lib/active_support/cache/memory_store.rb +46 -26
- data/lib/active_support/cache/redis_cache_store.rb +25 -25
- data/lib/active_support/cache/strategy/local_cache.rb +20 -5
- data/lib/active_support/cache.rb +87 -40
- data/lib/active_support/callbacks.rb +65 -56
- data/lib/active_support/concern.rb +46 -2
- data/lib/active_support/configurable.rb +3 -3
- data/lib/active_support/configuration_file.rb +51 -0
- data/lib/active_support/core_ext/benchmark.rb +2 -2
- data/lib/active_support/core_ext/class/attribute.rb +34 -44
- data/lib/active_support/core_ext/class/subclasses.rb +17 -38
- data/lib/active_support/core_ext/date/conversions.rb +2 -1
- data/lib/active_support/core_ext/date_and_time/calculations.rb +13 -0
- data/lib/active_support/core_ext/date_and_time/compatibility.rb +15 -0
- data/lib/active_support/core_ext/digest/uuid.rb +1 -0
- data/lib/active_support/core_ext/enumerable.rb +76 -4
- data/lib/active_support/core_ext/hash/conversions.rb +2 -2
- data/lib/active_support/core_ext/hash/deep_transform_values.rb +1 -1
- data/lib/active_support/core_ext/hash/keys.rb +1 -1
- data/lib/active_support/core_ext/hash/slice.rb +3 -2
- data/lib/active_support/core_ext/load_error.rb +1 -1
- data/lib/active_support/core_ext/marshal.rb +2 -0
- data/lib/active_support/core_ext/module/attr_internal.rb +2 -2
- data/lib/active_support/core_ext/module/attribute_accessors.rb +23 -29
- data/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb +8 -4
- data/lib/active_support/core_ext/module/concerning.rb +8 -2
- data/lib/active_support/core_ext/module/delegation.rb +38 -28
- data/lib/active_support/core_ext/module/introspection.rb +1 -25
- data/lib/active_support/core_ext/name_error.rb +29 -2
- data/lib/active_support/core_ext/numeric/conversions.rb +22 -18
- data/lib/active_support/core_ext/object/deep_dup.rb +1 -1
- data/lib/active_support/core_ext/object/json.rb +12 -1
- data/lib/active_support/core_ext/object/try.rb +2 -2
- data/lib/active_support/core_ext/range/compare_range.rb +9 -3
- data/lib/active_support/core_ext/range/include_time_with_zone.rb +8 -3
- data/lib/active_support/core_ext/regexp.rb +8 -1
- data/lib/active_support/core_ext/string/access.rb +5 -24
- data/lib/active_support/core_ext/string/conversions.rb +1 -0
- data/lib/active_support/core_ext/string/inflections.rb +38 -4
- data/lib/active_support/core_ext/string/inquiry.rb +1 -0
- data/lib/active_support/core_ext/string/multibyte.rb +2 -2
- data/lib/active_support/core_ext/string/output_safety.rb +3 -4
- data/lib/active_support/core_ext/string/starts_ends_with.rb +2 -2
- data/lib/active_support/core_ext/symbol/starts_ends_with.rb +14 -0
- data/lib/active_support/core_ext/symbol.rb +3 -0
- data/lib/active_support/core_ext/time/calculations.rb +19 -0
- data/lib/active_support/core_ext/time/conversions.rb +2 -0
- data/lib/active_support/core_ext/uri.rb +5 -1
- data/lib/active_support/core_ext.rb +1 -1
- data/lib/active_support/current_attributes/test_helper.rb +13 -0
- data/lib/active_support/current_attributes.rb +9 -2
- data/lib/active_support/dependencies/zeitwerk_integration.rb +4 -1
- data/lib/active_support/dependencies.rb +37 -18
- data/lib/active_support/deprecation/behaviors.rb +15 -2
- data/lib/active_support/deprecation/disallowed.rb +56 -0
- data/lib/active_support/deprecation/instance_delegator.rb +0 -1
- data/lib/active_support/deprecation/method_wrappers.rb +3 -2
- data/lib/active_support/deprecation/proxy_wrappers.rb +2 -2
- data/lib/active_support/deprecation/reporting.rb +50 -7
- data/lib/active_support/deprecation.rb +6 -1
- data/lib/active_support/descendants_tracker.rb +6 -2
- data/lib/active_support/digest.rb +2 -0
- data/lib/active_support/duration/iso8601_serializer.rb +15 -9
- data/lib/active_support/duration.rb +75 -25
- data/lib/active_support/encrypted_file.rb +19 -2
- data/lib/active_support/environment_inquirer.rb +20 -0
- data/lib/active_support/evented_file_update_checker.rb +69 -133
- data/lib/active_support/fork_tracker.rb +64 -0
- data/lib/active_support/gem_version.rb +2 -2
- data/lib/active_support/hash_with_indifferent_access.rb +48 -24
- data/lib/active_support/i18n_railtie.rb +14 -19
- data/lib/active_support/inflector/inflections.rb +1 -2
- data/lib/active_support/inflector/methods.rb +36 -33
- data/lib/active_support/inflector/transliterate.rb +4 -4
- data/lib/active_support/json/decoding.rb +4 -4
- data/lib/active_support/json/encoding.rb +5 -1
- data/lib/active_support/key_generator.rb +1 -1
- data/lib/active_support/locale/en.yml +7 -3
- data/lib/active_support/log_subscriber.rb +8 -0
- data/lib/active_support/logger.rb +1 -1
- data/lib/active_support/logger_silence.rb +2 -26
- data/lib/active_support/logger_thread_safe_level.rb +34 -12
- data/lib/active_support/message_encryptor.rb +4 -7
- data/lib/active_support/message_verifier.rb +5 -5
- data/lib/active_support/messages/rotation_configuration.rb +2 -1
- data/lib/active_support/messages/rotator.rb +6 -5
- data/lib/active_support/multibyte/chars.rb +4 -42
- data/lib/active_support/multibyte/unicode.rb +9 -83
- data/lib/active_support/notifications/fanout.rb +23 -8
- data/lib/active_support/notifications/instrumenter.rb +6 -15
- data/lib/active_support/notifications.rb +32 -5
- data/lib/active_support/number_helper/number_converter.rb +1 -1
- data/lib/active_support/number_helper/number_to_human_converter.rb +1 -1
- data/lib/active_support/number_helper/number_to_human_size_converter.rb +1 -1
- data/lib/active_support/number_helper/number_to_rounded_converter.rb +9 -5
- data/lib/active_support/number_helper/rounding_helper.rb +12 -28
- data/lib/active_support/number_helper.rb +29 -14
- data/lib/active_support/option_merger.rb +2 -1
- data/lib/active_support/ordered_options.rb +8 -2
- data/lib/active_support/parameter_filter.rb +16 -11
- data/lib/active_support/per_thread_registry.rb +2 -1
- data/lib/active_support/rails.rb +1 -4
- data/lib/active_support/railtie.rb +23 -1
- data/lib/active_support/rescuable.rb +4 -4
- data/lib/active_support/secure_compare_rotator.rb +51 -0
- data/lib/active_support/security_utils.rb +19 -12
- data/lib/active_support/string_inquirer.rb +4 -2
- data/lib/active_support/subscriber.rb +12 -7
- data/lib/active_support/tagged_logging.rb +30 -5
- data/lib/active_support/testing/assertions.rb +18 -11
- data/lib/active_support/testing/parallelization/server.rb +78 -0
- data/lib/active_support/testing/parallelization/worker.rb +100 -0
- data/lib/active_support/testing/parallelization.rb +12 -95
- data/lib/active_support/testing/time_helpers.rb +40 -3
- data/lib/active_support/time_with_zone.rb +67 -43
- data/lib/active_support/values/time_zone.rb +22 -10
- data/lib/active_support/xml_mini/rexml.rb +8 -1
- data/lib/active_support.rb +13 -1
- metadata +32 -34
- data/lib/active_support/core_ext/array/prepend_and_append.rb +0 -5
- data/lib/active_support/core_ext/hash/compact.rb +0 -5
- data/lib/active_support/core_ext/hash/transform_values.rb +0 -5
- data/lib/active_support/core_ext/module/reachable.rb +0 -6
- data/lib/active_support/core_ext/numeric/inquiry.rb +0 -5
- data/lib/active_support/core_ext/range/include_range.rb +0 -9
data/CHANGELOG.md
CHANGED
@@ -1,24 +1,26 @@
|
|
1
|
-
## Rails 6.
|
1
|
+
## Rails 6.1.7.1 (January 17, 2023) ##
|
2
2
|
|
3
|
-
*
|
3
|
+
* Avoid regex backtracking in Inflector.underscore
|
4
|
+
|
5
|
+
[CVE-2023-22796]
|
4
6
|
|
5
7
|
|
6
|
-
## Rails 6.
|
8
|
+
## Rails 6.1.7 (September 09, 2022) ##
|
7
9
|
|
8
10
|
* No changes.
|
9
11
|
|
10
12
|
|
11
|
-
## Rails 6.
|
13
|
+
## Rails 6.1.6.1 (July 12, 2022) ##
|
12
14
|
|
13
15
|
* No changes.
|
14
16
|
|
15
17
|
|
16
|
-
## Rails 6.
|
18
|
+
## Rails 6.1.6 (May 09, 2022) ##
|
17
19
|
|
18
20
|
* No changes.
|
19
21
|
|
20
22
|
|
21
|
-
## Rails 6.
|
23
|
+
## Rails 6.1.5.1 (April 26, 2022) ##
|
22
24
|
|
23
25
|
* Fix and add protections for XSS in `ActionView::Helpers` and `ERB::Util`.
|
24
26
|
|
@@ -27,756 +29,711 @@
|
|
27
29
|
|
28
30
|
*Álvaro Martín Fraguas*
|
29
31
|
|
32
|
+
## Rails 6.1.5 (March 09, 2022) ##
|
30
33
|
|
31
|
-
|
32
|
-
|
33
|
-
* No changes.
|
34
|
+
* Fix `ActiveSupport::Duration.build` to support negative values.
|
34
35
|
|
36
|
+
The algorithm to collect the `parts` of the `ActiveSupport::Duration`
|
37
|
+
ignored the sign of the `value` and accumulated incorrect part values. This
|
38
|
+
impacted `ActiveSupport::Duration#sum` (which is dependent on `parts`) but
|
39
|
+
not `ActiveSupport::Duration#eql?` (which is dependent on `value`).
|
35
40
|
|
36
|
-
|
41
|
+
*Caleb Buxton*, *Braden Staudacher*
|
37
42
|
|
38
|
-
*
|
43
|
+
* `Time#change` and methods that call it (eg. `Time#advance`) will now
|
44
|
+
return a `Time` with the timezone argument provided, if the caller was
|
45
|
+
initialized with a timezone argument.
|
39
46
|
|
47
|
+
Fixes [#42467](https://github.com/rails/rails/issues/42467).
|
40
48
|
|
41
|
-
|
49
|
+
*Alex Ghiculescu*
|
42
50
|
|
43
|
-
*
|
51
|
+
* Clone to keep extended Logger methods for tagged logger.
|
44
52
|
|
53
|
+
*Orhan Toy*
|
45
54
|
|
46
|
-
|
55
|
+
* `assert_changes` works on including `ActiveSupport::Assertions` module.
|
47
56
|
|
48
|
-
*
|
57
|
+
*Pedro Medeiros*
|
49
58
|
|
50
59
|
|
51
|
-
## Rails 6.
|
60
|
+
## Rails 6.1.4.7 (March 08, 2022) ##
|
52
61
|
|
53
62
|
* No changes.
|
54
63
|
|
55
64
|
|
56
|
-
## Rails 6.
|
65
|
+
## Rails 6.1.4.6 (February 11, 2022) ##
|
57
66
|
|
58
|
-
*
|
67
|
+
* Fix Reloader method signature to work with the new Executor signature
|
59
68
|
|
60
69
|
|
61
|
-
## Rails 6.
|
70
|
+
## Rails 6.1.4.5 (February 11, 2022) ##
|
62
71
|
|
63
72
|
* No changes.
|
64
73
|
|
65
74
|
|
66
|
-
## Rails 6.
|
67
|
-
|
68
|
-
* Fixed issue in `ActiveSupport::Cache::RedisCacheStore` not passing options
|
69
|
-
to `read_multi` causing `fetch_multi` to not work properly.
|
70
|
-
|
71
|
-
*Rajesh Sharma*
|
72
|
-
|
73
|
-
* `with_options` copies its options hash again to avoid leaking mutations.
|
74
|
-
|
75
|
-
Fixes #39343.
|
76
|
-
|
77
|
-
*Eugene Kenny*
|
78
|
-
|
79
|
-
|
80
|
-
## Rails 6.0.3.7 (May 05, 2021) ##
|
75
|
+
## Rails 6.1.4.4 (December 15, 2021) ##
|
81
76
|
|
82
77
|
* No changes.
|
83
78
|
|
84
79
|
|
85
|
-
## Rails 6.
|
80
|
+
## Rails 6.1.4.3 (December 14, 2021) ##
|
86
81
|
|
87
82
|
* No changes.
|
88
83
|
|
89
84
|
|
90
|
-
## Rails 6.
|
85
|
+
## Rails 6.1.4.2 (December 14, 2021) ##
|
91
86
|
|
92
87
|
* No changes.
|
93
88
|
|
94
89
|
|
95
|
-
## Rails 6.
|
90
|
+
## Rails 6.1.4.1 (August 19, 2021) ##
|
96
91
|
|
97
92
|
* No changes.
|
98
93
|
|
99
94
|
|
100
|
-
## Rails 6.
|
95
|
+
## Rails 6.1.4 (June 24, 2021) ##
|
101
96
|
|
102
|
-
*
|
97
|
+
* MemCacheStore: convert any underlying value (including `false`) to an `Entry`.
|
103
98
|
|
99
|
+
See [#42559](https://github.com/rails/rails/pull/42559).
|
104
100
|
|
105
|
-
|
101
|
+
*Alex Ghiculescu*
|
106
102
|
|
107
|
-
*
|
103
|
+
* Fix bug in `number_with_precision` when using large `BigDecimal` values.
|
108
104
|
|
105
|
+
Fixes #42302.
|
109
106
|
|
110
|
-
|
107
|
+
*Federico Aldunate*, *Zachary Scott*
|
111
108
|
|
112
|
-
*
|
109
|
+
* Check byte size instead of length on `secure_compare`.
|
113
110
|
|
114
|
-
*
|
111
|
+
*Tietew*
|
115
112
|
|
113
|
+
* Fix `Time.at` to not lose `:in` option.
|
116
114
|
|
117
|
-
|
115
|
+
*Ryuta Kamizono*
|
118
116
|
|
119
|
-
*
|
117
|
+
* Require a path for `config.cache_store = :file_store`.
|
120
118
|
|
121
|
-
|
119
|
+
*Alex Ghiculescu*
|
122
120
|
|
123
|
-
|
124
|
-
# => true
|
125
|
-
|
126
|
-
After:
|
121
|
+
* Avoid having to store complex object in the default translation file.
|
127
122
|
|
128
|
-
|
129
|
-
# => false
|
130
|
-
|
131
|
-
*Nicolas Dular*
|
132
|
-
|
133
|
-
* Update `ActiveSupport::Messages::Metadata#fresh?` to work for cookies with expiry set when
|
134
|
-
`ActiveSupport.parse_json_times = true`.
|
135
|
-
|
136
|
-
*Christian Gregg*
|
123
|
+
*Rafael Mendonça França*
|
137
124
|
|
138
125
|
|
139
|
-
## Rails 6.
|
126
|
+
## Rails 6.1.3.2 (May 05, 2021) ##
|
140
127
|
|
141
128
|
* No changes.
|
142
129
|
|
143
130
|
|
144
|
-
## Rails 6.
|
131
|
+
## Rails 6.1.3.1 (March 26, 2021) ##
|
145
132
|
|
146
133
|
* No changes.
|
147
134
|
|
148
135
|
|
149
|
-
## Rails 6.
|
150
|
-
|
151
|
-
* Eager load translations during initialization.
|
152
|
-
|
153
|
-
*Diego Plentz*
|
136
|
+
## Rails 6.1.3 (February 17, 2021) ##
|
154
137
|
|
155
|
-
*
|
156
|
-
|
157
|
-
*George Claghorn*
|
158
|
-
|
159
|
-
|
160
|
-
## Rails 6.0.1 (November 5, 2019) ##
|
161
|
-
|
162
|
-
* `ActiveSupport::SafeBuffer` supports `Enumerator` methods.
|
138
|
+
* No changes.
|
163
139
|
|
164
|
-
*Shugo Maeda*
|
165
140
|
|
166
|
-
|
167
|
-
of clients reached" error.
|
141
|
+
## Rails 6.1.2.1 (February 10, 2021) ##
|
168
142
|
|
169
|
-
|
143
|
+
* No changes.
|
170
144
|
|
171
|
-
* Fixed that mutating a value returned by a memory cache store would
|
172
|
-
unexpectedly change the cached value.
|
173
145
|
|
174
|
-
|
146
|
+
## Rails 6.1.2 (February 09, 2021) ##
|
175
147
|
|
176
|
-
*
|
148
|
+
* `ActiveSupport::Cache::MemCacheStore` now accepts an explicit `nil` for its `addresses` argument.
|
177
149
|
|
178
150
|
```ruby
|
179
|
-
|
180
|
-
Rails.autoloaders.each do |autoloader|
|
181
|
-
autoloader.inflector.inflect(
|
182
|
-
"html_parser" => "HTMLParser",
|
183
|
-
"ssl_error" => "SSLError"
|
184
|
-
)
|
185
|
-
end
|
186
|
-
```
|
187
|
-
|
188
|
-
That way, you can tweak how individual basenames are inflected without touching Active Support inflection rules, which are global. These inflectors fallback to `String#camelize`, so existing inflection rules are still taken into account for non-overridden basenames.
|
151
|
+
config.cache_store = :mem_cache_store, nil
|
189
152
|
|
190
|
-
|
191
|
-
|
192
|
-
*Xavier Noria*
|
153
|
+
# is now equivalent to
|
193
154
|
|
194
|
-
|
195
|
-
and endless range targets.
|
155
|
+
config.cache_store = :mem_cache_store
|
196
156
|
|
197
|
-
|
157
|
+
# and is also equivalent to
|
198
158
|
|
199
|
-
|
200
|
-
|
201
|
-
*Iain Beeston*
|
202
|
-
|
203
|
-
|
204
|
-
## Rails 6.0.0 (August 16, 2019) ##
|
205
|
-
|
206
|
-
* Let `require_dependency` in `zeitwerk` mode look the autoload paths up for
|
207
|
-
better backwards compatibility.
|
208
|
-
|
209
|
-
*Xavier Noria*
|
159
|
+
config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211"
|
210
160
|
|
211
|
-
|
212
|
-
|
161
|
+
# which is the fallback behavior of Dalli
|
162
|
+
```
|
213
163
|
|
214
|
-
|
164
|
+
This helps those migrating from `:dalli_store`, where an explicit `nil` was permitted.
|
215
165
|
|
216
|
-
*
|
166
|
+
*Michael Overmeyer*
|
217
167
|
|
218
|
-
Use `Fiber.current.__id__` in `ActiveSupport::Logger#local_level=` in order
|
219
|
-
to make log level local to Ruby Fibers in addition to Threads.
|
220
168
|
|
221
|
-
|
169
|
+
## Rails 6.1.1 (January 07, 2021) ##
|
222
170
|
|
223
|
-
|
224
|
-
|
225
|
-
p "Main is debug? #{logger.debug?}"
|
226
|
-
|
227
|
-
Fiber.new {
|
228
|
-
logger.local_level = 0
|
229
|
-
p "Thread is debug? #{logger.debug?}"
|
230
|
-
}.resume
|
231
|
-
|
232
|
-
p "Main is debug? #{logger.debug?}"
|
171
|
+
* Change `IPAddr#to_json` to match the behavior of the json gem returning the string representation
|
172
|
+
instead of the instance variables of the object.
|
233
173
|
|
234
174
|
Before:
|
235
175
|
|
236
|
-
|
237
|
-
|
238
|
-
|
176
|
+
```ruby
|
177
|
+
IPAddr.new("127.0.0.1").to_json
|
178
|
+
# => "{\"addr\":2130706433,\"family\":2,\"mask_addr\":4294967295}"
|
179
|
+
```
|
239
180
|
|
240
181
|
After:
|
241
182
|
|
242
|
-
|
243
|
-
|
244
|
-
|
183
|
+
```ruby
|
184
|
+
IPAddr.new("127.0.0.1").to_json
|
185
|
+
# => "\"127.0.0.1\""
|
186
|
+
```
|
245
187
|
|
246
|
-
*Alexander Varnin*
|
247
188
|
|
248
|
-
|
249
|
-
`delegate_missing_to` extension. This avoids unintentionally adding instance
|
250
|
-
variables when calling `Marshal.dump(object)`, should the delegation target of
|
251
|
-
`object` be a method which would otherwise add them. Fixes #36522.
|
189
|
+
## Rails 6.1.0 (December 09, 2020) ##
|
252
190
|
|
253
|
-
|
191
|
+
* Ensure `MemoryStore` disables compression by default. Reverts behavior of
|
192
|
+
`MemoryStore` to its prior rails `5.1` behavior.
|
254
193
|
|
194
|
+
*Max Gurewitz*
|
255
195
|
|
256
|
-
|
196
|
+
* Calling `iso8601` on negative durations retains the negative sign on individual
|
197
|
+
digits instead of prepending it.
|
257
198
|
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
with
|
199
|
+
This change is required so we can interoperate with PostgreSQL, which prefers
|
200
|
+
negative signs for each component.
|
201
|
+
|
202
|
+
Compatibility with other iso8601 parsers which support leading negatives as well
|
203
|
+
as negatives per component is still retained.
|
262
204
|
|
263
205
|
Before:
|
264
206
|
|
265
|
-
|
266
|
-
# =>
|
267
|
-
'foobar'.truncate(6).frozen?
|
268
|
-
# => false
|
207
|
+
(-1.year - 1.day).iso8601
|
208
|
+
# => "-P1Y1D"
|
269
209
|
|
270
210
|
After:
|
271
211
|
|
272
|
-
|
273
|
-
# =>
|
274
|
-
'foobar'.truncate(6).frozen?
|
275
|
-
# => false
|
276
|
-
|
277
|
-
*Jordan Thomas*
|
212
|
+
(-1.year - 1.day).iso8601
|
213
|
+
# => "P-1Y-1D"
|
278
214
|
|
215
|
+
*Vipul A M*
|
279
216
|
|
280
|
-
|
217
|
+
* Remove deprecated `ActiveSupport::Notifications::Instrumenter#end=`.
|
281
218
|
|
282
|
-
*
|
283
|
-
|
284
|
-
These methods now unset the `default`/`default_proc` on the returned Hash, compatible with Ruby 3.0’s native implementation.
|
285
|
-
|
286
|
-
*Timo Schilling*
|
287
|
-
|
288
|
-
* Introduce `ActiveSupport::ActionableError`.
|
289
|
-
|
290
|
-
Actionable errors let's you dispatch actions from Rails' error pages. This
|
291
|
-
can help you save time if you have a clear action for the resolution of
|
292
|
-
common development errors.
|
219
|
+
*Rafael Mendonça França*
|
293
220
|
|
294
|
-
|
295
|
-
are found, a middleware raises an error. With actionable errors, you can
|
296
|
-
run the migrations right from the error page. Other examples include Rails
|
297
|
-
plugins that need to run a rake task to setup themselves. They can now
|
298
|
-
raise actionable errors to run the setup straight from the error pages.
|
221
|
+
* Deprecate `ActiveSupport::Multibyte::Unicode.default_normalization_form`.
|
299
222
|
|
300
|
-
|
223
|
+
*Rafael Mendonça França*
|
301
224
|
|
302
|
-
|
303
|
-
|
304
|
-
|
225
|
+
* Remove deprecated `ActiveSupport::Multibyte::Unicode.pack_graphemes`,
|
226
|
+
`ActiveSupport::Multibyte::Unicode.unpack_graphemes`,
|
227
|
+
`ActiveSupport::Multibyte::Unicode.normalize`,
|
228
|
+
`ActiveSupport::Multibyte::Unicode.downcase`,
|
229
|
+
`ActiveSupport::Multibyte::Unicode.upcase` and `ActiveSupport::Multibyte::Unicode.swapcase`.
|
305
230
|
|
306
|
-
|
307
|
-
ActiveRecord::Tasks::DatabaseTasks.migrate
|
308
|
-
end
|
309
|
-
end
|
310
|
-
```
|
231
|
+
*Rafael Mendonça França*
|
311
232
|
|
312
|
-
|
313
|
-
module and invoke the `action` class macro to define the action. An action
|
314
|
-
needs a name and a procedure to execute. The name is shown as the name of a
|
315
|
-
button on the error pages. Once clicked, it will invoke the given
|
316
|
-
procedure.
|
233
|
+
* Remove deprecated `ActiveSupport::Multibyte::Chars#consumes?` and `ActiveSupport::Multibyte::Chars#normalize`.
|
317
234
|
|
318
|
-
*
|
235
|
+
*Rafael Mendonça França*
|
319
236
|
|
320
|
-
*
|
237
|
+
* Remove deprecated file `active_support/core_ext/range/include_range`.
|
321
238
|
|
322
|
-
|
239
|
+
*Rafael Mendonça França*
|
323
240
|
|
324
|
-
|
241
|
+
* Remove deprecated file `active_support/core_ext/hash/transform_values`.
|
325
242
|
|
326
|
-
|
243
|
+
*Rafael Mendonça França*
|
327
244
|
|
328
|
-
|
245
|
+
* Remove deprecated file `active_support/core_ext/hash/compact`.
|
329
246
|
|
330
|
-
*
|
247
|
+
*Rafael Mendonça França*
|
331
248
|
|
332
|
-
*
|
333
|
-
plugin to work.
|
249
|
+
* Remove deprecated file `active_support/core_ext/array/prepend_and_append`.
|
334
250
|
|
335
|
-
*
|
251
|
+
*Rafael Mendonça França*
|
336
252
|
|
337
|
-
*
|
338
|
-
longer implements `autoloaded_constants` or `autoloaded?` (undocumented,
|
339
|
-
anyway). Experience shows introspection does not have many use cases, and
|
340
|
-
troubleshooting is done by logging. With this design trade-off we are able
|
341
|
-
to use even less memory in all environments.
|
253
|
+
* Remove deprecated file `active_support/core_ext/numeric/inquiry`.
|
342
254
|
|
343
|
-
*
|
255
|
+
*Rafael Mendonça França*
|
344
256
|
|
345
|
-
*
|
346
|
-
and hence uses less memory when `config.cache_classes` is `true`, a standard
|
347
|
-
setup in production.
|
257
|
+
* Remove deprecated file `active_support/core_ext/module/reachable`.
|
348
258
|
|
349
|
-
*
|
259
|
+
*Rafael Mendonça França*
|
350
260
|
|
351
|
-
*
|
352
|
-
if present in their respective `config.eager_load_paths`.
|
261
|
+
* Remove deprecated `Module#parent_name`, `Module#parent` and `Module#parents`.
|
353
262
|
|
354
|
-
|
355
|
-
not to `config.eager_load_paths`. In that configuration, for example, files
|
356
|
-
in the `lib` directory should not be eager loaded.
|
263
|
+
*Rafael Mendonça França*
|
357
264
|
|
358
|
-
|
265
|
+
* Remove deprecated `ActiveSupport::LoggerThreadSafeLevel#after_initialize`.
|
359
266
|
|
360
|
-
*
|
267
|
+
*Rafael Mendonça França*
|
361
268
|
|
362
|
-
|
269
|
+
* Remove deprecated `LoggerSilence` constant.
|
363
270
|
|
364
|
-
|
271
|
+
*Rafael Mendonça França*
|
365
272
|
|
366
|
-
|
273
|
+
* Remove deprecated fallback to `I18n.default_local` when `config.i18n.fallbacks` is empty.
|
367
274
|
|
368
|
-
|
275
|
+
*Rafael Mendonça França*
|
369
276
|
|
370
|
-
|
277
|
+
* Remove entries from local cache on `RedisCacheStore#delete_matched`
|
371
278
|
|
372
|
-
|
279
|
+
Fixes #38627
|
373
280
|
|
374
|
-
*
|
375
|
-
be garbage collected.
|
281
|
+
*ojab*
|
376
282
|
|
377
|
-
|
283
|
+
* Speed up `ActiveSupport::SecurityUtils.fixed_length_secure_compare` by using
|
284
|
+
`OpenSSL.fixed_length_secure_compare`, if available.
|
378
285
|
|
379
|
-
*
|
380
|
-
passing a block optional. This will let users use
|
381
|
-
`ActiveSupport::Notifications` messaging features outside of
|
382
|
-
instrumentation.
|
286
|
+
*Nate Matykiewicz*
|
383
287
|
|
384
|
-
|
288
|
+
* `ActiveSupport::Cache::MemCacheStore` now checks `ENV["MEMCACHE_SERVERS"]` before falling back to `"localhost:11211"` if configured without any addresses.
|
385
289
|
|
386
|
-
|
290
|
+
```ruby
|
291
|
+
config.cache_store = :mem_cache_store
|
387
292
|
|
388
|
-
|
293
|
+
# is now equivalent to
|
389
294
|
|
390
|
-
|
295
|
+
config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211"
|
391
296
|
|
392
|
-
|
297
|
+
# instead of
|
393
298
|
|
394
|
-
|
299
|
+
config.cache_store = :mem_cache_store, "localhost:11211" # ignores ENV["MEMCACHE_SERVERS"]
|
300
|
+
```
|
395
301
|
|
396
|
-
|
302
|
+
*Sam Bostock*
|
397
303
|
|
398
|
-
|
304
|
+
* `ActiveSupport::Subscriber#attach_to` now accepts an `inherit_all:` argument. When set to true,
|
305
|
+
it allows a subscriber to receive events for methods defined in the subscriber's ancestor class(es).
|
399
306
|
|
400
|
-
|
307
|
+
```ruby
|
308
|
+
class ActionControllerSubscriber < ActiveSupport::Subscriber
|
309
|
+
attach_to :action_controller
|
401
310
|
|
402
|
-
|
311
|
+
def start_processing(event)
|
312
|
+
info "Processing by #{event.payload[:controller]}##{event.payload[:action]} as #{format}"
|
313
|
+
end
|
403
314
|
|
404
|
-
|
315
|
+
def redirect_to(event)
|
316
|
+
info { "Redirected to #{event.payload[:location]}" }
|
317
|
+
end
|
318
|
+
end
|
405
319
|
|
406
|
-
|
320
|
+
# We detach ActionControllerSubscriber from the :action_controller namespace so that our CustomActionControllerSubscriber
|
321
|
+
# can provide its own instrumentation for certain events in the namespace
|
322
|
+
ActionControllerSubscriber.detach_from(:action_controller)
|
407
323
|
|
408
|
-
|
409
|
-
|
410
|
-
ActiveSupport::Inflector.parameterize("Fünf autos", locale: :de) # => "fuenf-autos"
|
324
|
+
class CustomActionControllerSubscriber < ActionControllerSubscriber
|
325
|
+
attach_to :action_controller, inherit_all: true
|
411
326
|
|
412
|
-
|
327
|
+
def start_processing(event)
|
328
|
+
info "A custom response to start_processing events"
|
329
|
+
end
|
413
330
|
|
414
|
-
|
331
|
+
# => CustomActionControllerSubscriber will process events for "start_processing.action_controller" notifications
|
332
|
+
# using its own #start_processing implementation, while retaining ActionControllerSubscriber's instrumentation
|
333
|
+
# for "redirect_to.action_controller" notifications
|
334
|
+
end
|
335
|
+
```
|
415
336
|
|
416
|
-
|
337
|
+
*Adrianna Chang*
|
417
338
|
|
418
|
-
|
339
|
+
* Allow the digest class used to generate non-sensitive digests to be configured with `config.active_support.hash_digest_class`.
|
419
340
|
|
420
|
-
|
421
|
-
`Array#including` and `Enumerable#including`. Retained the old names as aliases.
|
341
|
+
`config.active_support.use_sha1_digests` is deprecated in favour of `config.active_support.hash_digest_class = ::Digest::SHA1`.
|
422
342
|
|
423
|
-
*
|
343
|
+
*Dirkjan Bussink*
|
424
344
|
|
425
|
-
*
|
345
|
+
* Fix bug to make memcached write_entry expire correctly with unless_exist
|
426
346
|
|
427
|
-
|
428
|
-
post.authors.including(Current.person) # => All the authors plus the current person!
|
347
|
+
*Jye Lee*
|
429
348
|
|
430
|
-
|
349
|
+
* Add `ActiveSupport::Duration` conversion methods
|
431
350
|
|
351
|
+
`in_seconds`, `in_minutes`, `in_hours`, `in_days`, `in_weeks`, `in_months`, and `in_years` return the respective duration covered.
|
432
352
|
|
433
|
-
|
353
|
+
*Jason York*
|
434
354
|
|
435
|
-
*
|
355
|
+
* Fixed issue in `ActiveSupport::Cache::RedisCacheStore` not passing options
|
356
|
+
to `read_multi` causing `fetch_multi` to not work properly
|
436
357
|
|
358
|
+
*Rajesh Sharma*
|
437
359
|
|
438
|
-
|
360
|
+
* Fixed issue in `ActiveSupport::Cache::MemCacheStore` which caused duplicate compression,
|
361
|
+
and caused the provided `compression_threshold` to not be respected.
|
439
362
|
|
440
|
-
*
|
363
|
+
*Max Gurewitz*
|
441
364
|
|
442
|
-
|
365
|
+
* Prevent `RedisCacheStore` and `MemCacheStore` from performing compression
|
366
|
+
when reading entries written with `raw: true`.
|
443
367
|
|
444
|
-
*
|
368
|
+
*Max Gurewitz*
|
445
369
|
|
446
|
-
|
370
|
+
* `URI.parser` is deprecated and will be removed in Rails 7.0. Use
|
371
|
+
`URI::DEFAULT_PARSER` instead.
|
447
372
|
|
448
|
-
*
|
373
|
+
*Jean Boussier*
|
449
374
|
|
450
|
-
|
375
|
+
* `require_dependency` has been documented to be _obsolete_ in `:zeitwerk`
|
376
|
+
mode. The method is not deprecated as such (yet), but applications are
|
377
|
+
encouraged to not use it.
|
451
378
|
|
452
|
-
|
379
|
+
In `:zeitwerk` mode, semantics match Ruby's and you do not need to be
|
380
|
+
defensive with load order. Just refer to classes and modules normally. If
|
381
|
+
the constant name is dynamic, camelize if needed, and constantize.
|
453
382
|
|
454
|
-
*
|
383
|
+
*Xavier Noria*
|
455
384
|
|
456
|
-
* Add `
|
385
|
+
* Add 3rd person aliases of `Symbol#start_with?` and `Symbol#end_with?`.
|
457
386
|
|
458
|
-
|
387
|
+
```ruby
|
388
|
+
:foo.starts_with?("f") # => true
|
389
|
+
:foo.ends_with?("o") # => true
|
390
|
+
```
|
459
391
|
|
460
|
-
*
|
392
|
+
*Ryuta Kamizono*
|
461
393
|
|
462
|
-
* Add
|
394
|
+
* Add override of unary plus for `ActiveSupport::Duration`.
|
463
395
|
|
464
|
-
|
396
|
+
`+ 1.second` is now identical to `+1.second` to prevent errors
|
397
|
+
where a seemingly innocent change of formatting leads to a change in the code behavior.
|
465
398
|
|
399
|
+
Before:
|
400
|
+
```ruby
|
401
|
+
+1.second.class
|
402
|
+
# => ActiveSupport::Duration
|
403
|
+
(+ 1.second).class
|
404
|
+
# => Integer
|
405
|
+
```
|
466
406
|
|
467
|
-
|
407
|
+
After:
|
408
|
+
```ruby
|
409
|
+
+1.second.class
|
410
|
+
# => ActiveSupport::Duration
|
411
|
+
(+ 1.second).class
|
412
|
+
# => ActiveSupport::Duration
|
413
|
+
```
|
468
414
|
|
469
|
-
|
415
|
+
Fixes #39079.
|
470
416
|
|
471
|
-
*
|
417
|
+
*Roman Kushnir*
|
472
418
|
|
473
|
-
*
|
419
|
+
* Add subsec to `ActiveSupport::TimeWithZone#inspect`.
|
474
420
|
|
475
|
-
|
421
|
+
Before:
|
476
422
|
|
477
|
-
|
423
|
+
Time.at(1498099140).in_time_zone.inspect
|
424
|
+
# => "Thu, 22 Jun 2017 02:39:00 UTC +00:00"
|
425
|
+
Time.at(1498099140, 123456780, :nsec).in_time_zone.inspect
|
426
|
+
# => "Thu, 22 Jun 2017 02:39:00 UTC +00:00"
|
427
|
+
Time.at(1498099140 + Rational("1/3")).in_time_zone.inspect
|
428
|
+
# => "Thu, 22 Jun 2017 02:39:00 UTC +00:00"
|
478
429
|
|
479
|
-
|
430
|
+
After:
|
480
431
|
|
481
|
-
|
432
|
+
Time.at(1498099140).in_time_zone.inspect
|
433
|
+
# => "Thu, 22 Jun 2017 02:39:00.000000000 UTC +00:00"
|
434
|
+
Time.at(1498099140, 123456780, :nsec).in_time_zone.inspect
|
435
|
+
# => "Thu, 22 Jun 2017 02:39:00.123456780 UTC +00:00"
|
436
|
+
Time.at(1498099140 + Rational("1/3")).in_time_zone.inspect
|
437
|
+
# => "Thu, 22 Jun 2017 02:39:00.333333333 UTC +00:00"
|
482
438
|
|
483
|
-
|
439
|
+
*akinomaeni*
|
484
440
|
|
485
|
-
|
441
|
+
* Calling `ActiveSupport::TaggedLogging#tagged` without a block now returns a tagged logger.
|
486
442
|
|
487
|
-
|
443
|
+
```ruby
|
444
|
+
logger.tagged("BCX").info("Funky time!") # => [BCX] Funky time!
|
445
|
+
```
|
488
446
|
|
489
|
-
*
|
447
|
+
*Eugene Kenny*
|
490
448
|
|
491
|
-
*
|
492
|
-
would not act as alias for `#symbolize_keys`.
|
449
|
+
* Align `Range#cover?` extension behavior with Ruby behavior for backwards ranges.
|
493
450
|
|
494
|
-
|
451
|
+
`(1..10).cover?(5..3)` now returns `false`, as it does in plain Ruby.
|
495
452
|
|
496
|
-
|
453
|
+
Also update `#include?` and `#===` behavior to match.
|
497
454
|
|
498
|
-
*
|
455
|
+
*Michael Groeneman*
|
499
456
|
|
500
|
-
*
|
501
|
-
in favor of `array.flatten.pack("U*")` and `string.scan(/\X/).map(&:codepoints)`, respectively.
|
457
|
+
* Update to TZInfo v2.0.0.
|
502
458
|
|
503
|
-
|
459
|
+
This changes the output of `ActiveSupport::TimeZone.utc_to_local`, but
|
460
|
+
can be controlled with the
|
461
|
+
`ActiveSupport.utc_to_local_returns_utc_offset_times` config.
|
504
462
|
|
505
|
-
|
463
|
+
New Rails 6.1 apps have it enabled by default, existing apps can upgrade
|
464
|
+
via the config in config/initializers/new_framework_defaults_6_1.rb
|
506
465
|
|
507
|
-
|
466
|
+
See the `utc_to_local_returns_utc_offset_times` documentation for details.
|
508
467
|
|
509
|
-
*
|
510
|
-
```
|
511
|
-
time = DateTime.parse("2018-1-1")
|
512
|
-
time += 0.51.seconds
|
513
|
-
```
|
514
|
-
Will now correctly add 0.51 second and not 1 full second.
|
468
|
+
*Phil Ross*, *Jared Beck*
|
515
469
|
|
516
|
-
|
470
|
+
* Add Date and Time `#yesterday?` and `#tomorrow?` alongside `#today?`.
|
517
471
|
|
518
|
-
|
519
|
-
in favor of `String#unicode_normalize`
|
472
|
+
Aliased to `#prev_day?` and `#next_day?` to match the existing `#prev/next_day` methods.
|
520
473
|
|
521
|
-
*
|
474
|
+
*Jatin Dhankhar*
|
522
475
|
|
523
|
-
*
|
524
|
-
`String#downcase/upcase/swapcase`.
|
476
|
+
* Add `Enumerable#pick` to complement `ActiveRecord::Relation#pick`.
|
525
477
|
|
526
|
-
*
|
478
|
+
*Eugene Kenny*
|
527
479
|
|
528
|
-
*
|
480
|
+
* [Breaking change] `ActiveSupport::Callbacks#halted_callback_hook` now receive a 2nd argument:
|
529
481
|
|
530
|
-
|
482
|
+
`ActiveSupport::Callbacks#halted_callback_hook` now receive the name of the callback
|
483
|
+
being halted as second argument.
|
484
|
+
This change will allow you to differentiate which callbacks halted the chain
|
485
|
+
and act accordingly.
|
531
486
|
|
532
|
-
|
533
|
-
|
487
|
+
```ruby
|
488
|
+
class Book < ApplicationRecord
|
489
|
+
before_save { throw(:abort) }
|
490
|
+
before_create { throw(:abort) }
|
534
491
|
|
535
|
-
|
492
|
+
def halted_callback_hook(filter, callback_name)
|
493
|
+
Rails.logger.info("Book couldn't be #{callback_name}d")
|
494
|
+
end
|
536
495
|
|
537
|
-
|
496
|
+
Book.create # => "Book couldn't be created"
|
497
|
+
book.save # => "Book couldn't be saved"
|
498
|
+
end
|
499
|
+
```
|
538
500
|
|
539
501
|
*Edouard Chin*
|
540
502
|
|
541
|
-
*
|
503
|
+
* Support `prepend` with `ActiveSupport::Concern`.
|
542
504
|
|
543
|
-
|
505
|
+
Allows a module with `extend ActiveSupport::Concern` to be prepended.
|
544
506
|
|
545
|
-
|
546
|
-
|
507
|
+
module Imposter
|
508
|
+
extend ActiveSupport::Concern
|
547
509
|
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
*Janosch Müller*
|
554
|
-
|
555
|
-
* Changed `ActiveSupport::TaggedLogging.new` to return a new logger instance instead
|
556
|
-
of mutating the one received as parameter.
|
557
|
-
|
558
|
-
*Thierry Joyal*
|
510
|
+
# Same as `included`, except only run when prepended.
|
511
|
+
prepended do
|
512
|
+
end
|
513
|
+
end
|
559
514
|
|
560
|
-
|
515
|
+
class Person
|
516
|
+
prepend Imposter
|
517
|
+
end
|
561
518
|
|
562
|
-
|
519
|
+
Class methods are prepended to the base class, concerning is also
|
520
|
+
updated: `concerning :Imposter, prepend: true do`.
|
563
521
|
|
564
|
-
*
|
522
|
+
*Jason Karns*, *Elia Schito*
|
565
523
|
|
566
|
-
*
|
524
|
+
* Deprecate using `Range#include?` method to check the inclusion of a value
|
525
|
+
in a date time range. It is recommended to use `Range#cover?` method
|
526
|
+
instead of `Range#include?` to check the inclusion of a value
|
527
|
+
in a date time range.
|
567
528
|
|
568
|
-
|
569
|
-
ActiveSupport::Dependencies.verbose = true
|
529
|
+
*Vishal Telangre*
|
570
530
|
|
571
|
-
|
531
|
+
* Support added for a `round_mode` parameter, in all number helpers. (See: `BigDecimal::mode`.)
|
572
532
|
|
573
|
-
|
574
|
-
|
575
|
-
|
533
|
+
```ruby
|
534
|
+
number_to_currency(1234567890.50, precision: 0, round_mode: :half_down) # => "$1,234,567,890"
|
535
|
+
number_to_percentage(302.24398923423, precision: 5, round_mode: :down) # => "302.24398%"
|
536
|
+
number_to_rounded(389.32314, precision: 0, round_mode: :ceil) # => "390"
|
537
|
+
number_to_human_size(483989, precision: 2, round_mode: :up) # => "480 KB"
|
538
|
+
number_to_human(489939, precision: 2, round_mode: :floor) # => "480 Thousand"
|
576
539
|
|
577
|
-
|
578
|
-
|
540
|
+
485000.to_s(:human, precision: 2, round_mode: :half_even) # => "480 Thousand"
|
541
|
+
```
|
579
542
|
|
580
|
-
*
|
543
|
+
*Tom Lord*
|
581
544
|
|
582
|
-
*
|
545
|
+
* `Array#to_sentence` no longer returns a frozen string.
|
583
546
|
|
584
|
-
|
585
|
-
If no block is given, an Enumerator is returned instead.
|
547
|
+
Before:
|
586
548
|
|
587
|
-
|
588
|
-
|
589
|
-
numbers # => [0, 2, 4, 6, 8]
|
549
|
+
['one', 'two'].to_sentence.frozen?
|
550
|
+
# => true
|
590
551
|
|
591
|
-
|
552
|
+
After:
|
592
553
|
|
593
|
-
|
554
|
+
['one', 'two'].to_sentence.frozen?
|
555
|
+
# => false
|
594
556
|
|
595
|
-
|
596
|
-
cache.exist?('bar') # => false
|
557
|
+
*Nicolas Dular*
|
597
558
|
|
598
|
-
|
559
|
+
* When an instance of `ActiveSupport::Duration` is converted to an `iso8601` duration string, if `weeks` are mixed with `date` parts, the `week` part will be converted to days.
|
560
|
+
This keeps the parser and serializer on the same page.
|
599
561
|
|
600
|
-
|
601
|
-
|
602
|
-
|
562
|
+
```ruby
|
563
|
+
duration = ActiveSupport::Duration.build(1000000)
|
564
|
+
# 1 week, 4 days, 13 hours, 46 minutes, and 40.0 seconds
|
603
565
|
|
604
|
-
|
605
|
-
|
606
|
-
end
|
566
|
+
duration_iso = duration.iso8601
|
567
|
+
# P11DT13H46M40S
|
607
568
|
|
608
|
-
|
609
|
-
|
610
|
-
end
|
569
|
+
ActiveSupport::Duration.parse(duration_iso)
|
570
|
+
# 11 days, 13 hours, 46 minutes, and 40 seconds
|
611
571
|
|
612
|
-
|
572
|
+
duration = ActiveSupport::Duration.build(604800)
|
573
|
+
# 1 week
|
613
574
|
|
614
|
-
|
615
|
-
|
616
|
-
end users are no longer required to make their own:
|
575
|
+
duration_iso = duration.iso8601
|
576
|
+
# P1W
|
617
577
|
|
618
|
-
|
619
|
-
|
620
|
-
|
578
|
+
ActiveSupport::Duration.parse(duration_iso)
|
579
|
+
# 1 week
|
580
|
+
```
|
621
581
|
|
622
|
-
|
623
|
-
sleep 1
|
624
|
-
end
|
582
|
+
*Abhishek Sarkar*
|
625
583
|
|
626
|
-
|
627
|
-
p @event.cpu_time # => 0.256
|
628
|
-
p @event.idle_time # => 1003.2399
|
584
|
+
* Add block support to `ActiveSupport::Testing::TimeHelpers#travel_back`.
|
629
585
|
|
630
|
-
|
586
|
+
*Tim Masliuchenko*
|
631
587
|
|
632
|
-
|
588
|
+
* Update `ActiveSupport::Messages::Metadata#fresh?` to work for cookies with expiry set when
|
589
|
+
`ActiveSupport.parse_json_times = true`.
|
633
590
|
|
634
|
-
*
|
591
|
+
*Christian Gregg*
|
635
592
|
|
636
|
-
|
593
|
+
* Support symbolic links for `content_path` in `ActiveSupport::EncryptedFile`.
|
637
594
|
|
638
|
-
*
|
595
|
+
*Takumi Shotoku*
|
639
596
|
|
640
|
-
|
597
|
+
* Improve `Range#===`, `Range#include?`, and `Range#cover?` to work with beginless (startless)
|
598
|
+
and endless range targets.
|
641
599
|
|
642
|
-
|
600
|
+
*Allen Hsu*, *Andrew Hodgkinson*
|
643
601
|
|
644
|
-
|
602
|
+
* Don't use `Process#clock_gettime(CLOCK_THREAD_CPUTIME_ID)` on Solaris.
|
645
603
|
|
646
|
-
*
|
604
|
+
*Iain Beeston*
|
647
605
|
|
648
|
-
*
|
606
|
+
* Prevent `ActiveSupport::Duration.build(value)` from creating instances of
|
607
|
+
`ActiveSupport::Duration` unless `value` is of type `Numeric`.
|
649
608
|
|
650
|
-
|
651
|
-
`
|
652
|
-
|
609
|
+
Addresses the errant set of behaviours described in #37012 where
|
610
|
+
`ActiveSupport::Duration` comparisons would fail confusingly
|
611
|
+
or return unexpected results when comparing durations built from instances of `String`.
|
653
612
|
|
654
|
-
|
655
|
-
*Use `require "active_support/core_ext/range/compare_range"` instead.*
|
613
|
+
Before:
|
656
614
|
|
657
|
-
|
615
|
+
small_duration_from_string = ActiveSupport::Duration.build('9')
|
616
|
+
large_duration_from_string = ActiveSupport::Duration.build('100000000000000')
|
617
|
+
small_duration_from_int = ActiveSupport::Duration.build(9)
|
658
618
|
|
659
|
-
|
619
|
+
large_duration_from_string > small_duration_from_string
|
620
|
+
# => false
|
660
621
|
|
661
|
-
|
662
|
-
|
622
|
+
small_duration_from_string == small_duration_from_int
|
623
|
+
# => false
|
663
624
|
|
664
|
-
|
665
|
-
# =>
|
625
|
+
small_duration_from_int < large_duration_from_string
|
626
|
+
# => ArgumentError (comparison of ActiveSupport::Duration::Scalar with ActiveSupport::Duration failed)
|
666
627
|
|
667
|
-
|
668
|
-
# =>
|
628
|
+
large_duration_from_string > small_duration_from_int
|
629
|
+
# => ArgumentError (comparison of String with ActiveSupport::Duration failed)
|
669
630
|
|
670
|
-
|
631
|
+
After:
|
671
632
|
|
672
|
-
|
633
|
+
small_duration_from_string = ActiveSupport::Duration.build('9')
|
634
|
+
# => TypeError (can't build an ActiveSupport::Duration from a String)
|
673
635
|
|
674
|
-
*
|
675
|
-
any timezone defined in `ActiveSupport::TimeZone::MAPPING` is missing.
|
636
|
+
*Alexei Emam*
|
676
637
|
|
677
|
-
|
638
|
+
* Add `ActiveSupport::Cache::Store#delete_multi` method to delete multiple keys from the cache store.
|
678
639
|
|
679
|
-
*
|
680
|
-
(Switches from evaled Lua to a batched SCAN + DEL loop.)
|
640
|
+
*Peter Zhu*
|
681
641
|
|
682
|
-
|
642
|
+
* Support multiple arguments in `HashWithIndifferentAccess` for `merge` and `update` methods, to
|
643
|
+
follow Ruby 2.6 addition.
|
683
644
|
|
684
|
-
*
|
685
|
-
size when compression is enabled (which is true by default). This patch
|
686
|
-
does not attempt to repair existing data: please manually flush the cache
|
687
|
-
to clear out the problematic entries.
|
645
|
+
*Wojciech Wnętrzak*
|
688
646
|
|
689
|
-
|
647
|
+
* Allow initializing `thread_mattr_*` attributes via `:default` option.
|
690
648
|
|
691
|
-
|
649
|
+
class Scraper
|
650
|
+
thread_mattr_reader :client, default: Api::Client.new
|
651
|
+
end
|
692
652
|
|
693
|
-
|
694
|
-
URI.unescape("%E3%83%90") # => "バ"
|
695
|
-
URI.unescape("\xe3\x83\x90%E3%83%90") # => Encoding::CompatibilityError
|
653
|
+
*Guilherme Mansur*
|
696
654
|
|
697
|
-
|
655
|
+
* Add `compact_blank` for those times when you want to remove #blank? values from
|
656
|
+
an Enumerable (also `compact_blank!` on Hash, Array, ActionController::Parameters).
|
698
657
|
|
699
|
-
*
|
700
|
-
`Time`, and `TimeWithZone`.
|
658
|
+
*Dana Sherson*
|
701
659
|
|
702
|
-
|
660
|
+
* Make ActiveSupport::Logger Fiber-safe.
|
703
661
|
|
704
|
-
|
705
|
-
|
662
|
+
Use `Fiber.current.__id__` in `ActiveSupport::Logger#local_level=` in order
|
663
|
+
to make log level local to Ruby Fibers in addition to Threads.
|
706
664
|
|
707
|
-
|
665
|
+
Example:
|
708
666
|
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
nth: {
|
713
|
-
ordinals: lambda do |_key, number:, **_options|
|
714
|
-
if number.to_i.abs == 1
|
715
|
-
'er'
|
716
|
-
else
|
717
|
-
'e'
|
718
|
-
end
|
719
|
-
end,
|
667
|
+
logger = ActiveSupport::Logger.new(STDOUT)
|
668
|
+
logger.level = 1
|
669
|
+
puts "Main is debug? #{logger.debug?}"
|
720
670
|
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
}
|
726
|
-
}
|
727
|
-
}
|
671
|
+
Fiber.new {
|
672
|
+
logger.local_level = 0
|
673
|
+
puts "Thread is debug? #{logger.debug?}"
|
674
|
+
}.resume
|
728
675
|
|
676
|
+
puts "Main is debug? #{logger.debug?}"
|
729
677
|
|
730
|
-
|
678
|
+
Before:
|
731
679
|
|
732
|
-
|
733
|
-
|
680
|
+
Main is debug? false
|
681
|
+
Thread is debug? true
|
682
|
+
Main is debug? true
|
734
683
|
|
735
|
-
|
736
|
-
has_one :profile
|
737
|
-
delegate :date_of_birth, to: :profile, private: true
|
684
|
+
After:
|
738
685
|
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
end
|
686
|
+
Main is debug? false
|
687
|
+
Thread is debug? true
|
688
|
+
Main is debug? false
|
743
689
|
|
744
|
-
|
745
|
-
# User.new.date_of_birth
|
746
|
-
# => NoMethodError: private method `date_of_birth' called for #<User:0x00000008221340>
|
690
|
+
Fixes #36752.
|
747
691
|
|
748
|
-
*
|
692
|
+
*Alexander Varnin*
|
749
693
|
|
750
|
-
* `
|
751
|
-
|
694
|
+
* Allow the `on_rotation` proc used when decrypting/verifying a message to be
|
695
|
+
passed at the constructor level.
|
752
696
|
|
753
|
-
|
697
|
+
Before:
|
754
698
|
|
755
|
-
|
699
|
+
crypt = ActiveSupport::MessageEncryptor.new('long_secret')
|
700
|
+
crypt.decrypt_and_verify(encrypted_message, on_rotation: proc { ... })
|
701
|
+
crypt.decrypt_and_verify(another_encrypted_message, on_rotation: proc { ... })
|
756
702
|
|
757
|
-
|
703
|
+
After:
|
758
704
|
|
759
|
-
|
705
|
+
crypt = ActiveSupport::MessageEncryptor.new('long_secret', on_rotation: proc { ... })
|
706
|
+
crypt.decrypt_and_verify(encrypted_message)
|
707
|
+
crypt.decrypt_and_verify(another_encrypted_message)
|
760
708
|
|
761
|
-
|
709
|
+
*Edouard Chin*
|
762
710
|
|
763
|
-
|
764
|
-
|
765
|
-
|
711
|
+
* `delegate_missing_to` would raise a `DelegationError` if the object
|
712
|
+
delegated to was `nil`. Now the `allow_nil` option has been added to enable
|
713
|
+
the user to specify they want `nil` returned in this case.
|
766
714
|
|
767
|
-
|
715
|
+
*Matthew Tanous*
|
768
716
|
|
769
|
-
|
717
|
+
* `truncate` would return the original string if it was too short to be truncated
|
718
|
+
and a frozen string if it were long enough to be truncated. Now truncate will
|
719
|
+
consistently return an unfrozen string regardless. This behavior is consistent
|
720
|
+
with `gsub` and `strip`.
|
770
721
|
|
771
|
-
|
722
|
+
Before:
|
772
723
|
|
773
|
-
|
724
|
+
'foobar'.truncate(5).frozen?
|
725
|
+
# => true
|
726
|
+
'foobar'.truncate(6).frozen?
|
727
|
+
# => false
|
774
728
|
|
775
|
-
|
729
|
+
After:
|
776
730
|
|
777
|
-
|
731
|
+
'foobar'.truncate(5).frozen?
|
732
|
+
# => false
|
733
|
+
'foobar'.truncate(6).frozen?
|
734
|
+
# => false
|
778
735
|
|
779
|
-
*
|
736
|
+
*Jordan Thomas*
|
780
737
|
|
781
738
|
|
782
|
-
Please check [
|
739
|
+
Please check [6-0-stable](https://github.com/rails/rails/blob/6-0-stable/activesupport/CHANGELOG.md) for previous changes.
|