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