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