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