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