activesupport 6.1.4.1 → 7.0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +325 -395
- data/MIT-LICENSE +1 -1
- data/README.rdoc +2 -2
- data/lib/active_support/actionable_error.rb +1 -1
- data/lib/active_support/array_inquirer.rb +0 -2
- data/lib/active_support/backtrace_cleaner.rb +2 -2
- data/lib/active_support/benchmarkable.rb +2 -2
- data/lib/active_support/cache/file_store.rb +15 -9
- data/lib/active_support/cache/mem_cache_store.rb +148 -37
- data/lib/active_support/cache/memory_store.rb +24 -16
- data/lib/active_support/cache/null_store.rb +10 -2
- data/lib/active_support/cache/redis_cache_store.rb +68 -85
- data/lib/active_support/cache/strategy/local_cache.rb +38 -61
- data/lib/active_support/cache.rb +299 -147
- data/lib/active_support/callbacks.rb +184 -85
- data/lib/active_support/code_generator.rb +65 -0
- data/lib/active_support/concern.rb +5 -5
- data/lib/active_support/concurrency/load_interlock_aware_monitor.rb +2 -4
- data/lib/active_support/concurrency/share_lock.rb +2 -2
- data/lib/active_support/configurable.rb +8 -5
- data/lib/active_support/configuration_file.rb +1 -1
- data/lib/active_support/core_ext/array/access.rb +1 -5
- data/lib/active_support/core_ext/array/conversions.rb +13 -12
- data/lib/active_support/core_ext/array/deprecated_conversions.rb +25 -0
- data/lib/active_support/core_ext/array/grouping.rb +6 -6
- data/lib/active_support/core_ext/array/inquiry.rb +2 -2
- data/lib/active_support/core_ext/array.rb +1 -0
- data/lib/active_support/core_ext/big_decimal/conversions.rb +1 -1
- data/lib/active_support/core_ext/class/subclasses.rb +25 -17
- data/lib/active_support/core_ext/date/blank.rb +1 -1
- data/lib/active_support/core_ext/date/calculations.rb +24 -9
- data/lib/active_support/core_ext/date/conversions.rb +14 -14
- data/lib/active_support/core_ext/date/deprecated_conversions.rb +40 -0
- data/lib/active_support/core_ext/date.rb +1 -0
- data/lib/active_support/core_ext/date_and_time/calculations.rb +4 -4
- data/lib/active_support/core_ext/date_and_time/compatibility.rb +1 -1
- data/lib/active_support/core_ext/date_time/blank.rb +1 -1
- data/lib/active_support/core_ext/date_time/calculations.rb +4 -0
- data/lib/active_support/core_ext/date_time/conversions.rb +13 -13
- data/lib/active_support/core_ext/date_time/deprecated_conversions.rb +36 -0
- data/lib/active_support/core_ext/date_time.rb +1 -0
- data/lib/active_support/core_ext/digest/uuid.rb +39 -13
- data/lib/active_support/core_ext/enumerable.rb +112 -38
- data/lib/active_support/core_ext/file/atomic.rb +3 -1
- data/lib/active_support/core_ext/hash/conversions.rb +0 -1
- data/lib/active_support/core_ext/hash/deep_transform_values.rb +3 -3
- data/lib/active_support/core_ext/hash/indifferent_access.rb +3 -3
- data/lib/active_support/core_ext/hash/keys.rb +4 -4
- data/lib/active_support/core_ext/integer/inflections.rb +12 -12
- data/lib/active_support/core_ext/kernel/reporting.rb +4 -4
- data/lib/active_support/core_ext/kernel/singleton_class.rb +1 -1
- data/lib/active_support/core_ext/module/attribute_accessors.rb +2 -0
- data/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb +19 -10
- data/lib/active_support/core_ext/module/delegation.rb +2 -8
- data/lib/active_support/core_ext/name_error.rb +2 -8
- data/lib/active_support/core_ext/numeric/conversions.rb +80 -77
- data/lib/active_support/core_ext/numeric/deprecated_conversions.rb +60 -0
- data/lib/active_support/core_ext/numeric.rb +1 -0
- data/lib/active_support/core_ext/object/acts_like.rb +29 -5
- data/lib/active_support/core_ext/object/blank.rb +2 -2
- data/lib/active_support/core_ext/object/deep_dup.rb +1 -1
- data/lib/active_support/core_ext/object/duplicable.rb +15 -4
- data/lib/active_support/core_ext/object/json.rb +30 -25
- data/lib/active_support/core_ext/object/to_query.rb +2 -4
- data/lib/active_support/core_ext/object/try.rb +20 -20
- data/lib/active_support/core_ext/object/with_options.rb +21 -2
- data/lib/active_support/core_ext/pathname/existence.rb +21 -0
- data/lib/active_support/core_ext/pathname.rb +3 -0
- data/lib/active_support/core_ext/range/compare_range.rb +0 -25
- data/lib/active_support/core_ext/range/conversions.rb +8 -8
- data/lib/active_support/core_ext/range/deprecated_conversions.rb +36 -0
- data/lib/active_support/core_ext/range/each.rb +1 -1
- data/lib/active_support/core_ext/range/include_time_with_zone.rb +3 -26
- data/lib/active_support/core_ext/range/overlaps.rb +1 -1
- data/lib/active_support/core_ext/range.rb +1 -1
- data/lib/active_support/core_ext/securerandom.rb +1 -1
- data/lib/active_support/core_ext/string/conversions.rb +2 -2
- data/lib/active_support/core_ext/string/filters.rb +1 -1
- data/lib/active_support/core_ext/string/inflections.rb +1 -5
- data/lib/active_support/core_ext/string/inquiry.rb +1 -1
- data/lib/active_support/core_ext/string/output_safety.rb +94 -38
- data/lib/active_support/core_ext/symbol/starts_ends_with.rb +0 -8
- data/lib/active_support/core_ext/time/calculations.rb +13 -8
- data/lib/active_support/core_ext/time/conversions.rb +13 -12
- data/lib/active_support/core_ext/time/deprecated_conversions.rb +73 -0
- data/lib/active_support/core_ext/time/zones.rb +10 -26
- data/lib/active_support/core_ext/time.rb +1 -0
- data/lib/active_support/core_ext/uri.rb +3 -27
- data/lib/active_support/core_ext.rb +1 -0
- data/lib/active_support/current_attributes.rb +31 -14
- data/lib/active_support/dependencies/interlock.rb +10 -18
- data/lib/active_support/dependencies/require_dependency.rb +28 -0
- data/lib/active_support/dependencies.rb +58 -788
- data/lib/active_support/deprecation/behaviors.rb +8 -5
- data/lib/active_support/deprecation/disallowed.rb +3 -3
- data/lib/active_support/deprecation/method_wrappers.rb +3 -3
- data/lib/active_support/deprecation/proxy_wrappers.rb +2 -2
- data/lib/active_support/deprecation.rb +2 -2
- data/lib/active_support/descendants_tracker.rb +174 -68
- data/lib/active_support/digest.rb +5 -3
- data/lib/active_support/duration/iso8601_parser.rb +3 -3
- data/lib/active_support/duration/iso8601_serializer.rb +9 -1
- data/lib/active_support/duration.rb +81 -51
- data/lib/active_support/encrypted_configuration.rb +45 -3
- data/lib/active_support/encrypted_file.rb +21 -10
- data/lib/active_support/environment_inquirer.rb +1 -1
- data/lib/active_support/error_reporter.rb +117 -0
- data/lib/active_support/evented_file_update_checker.rb +20 -7
- data/lib/active_support/execution_context/test_helper.rb +13 -0
- data/lib/active_support/execution_context.rb +53 -0
- data/lib/active_support/execution_wrapper.rb +43 -21
- data/lib/active_support/executor/test_helper.rb +7 -0
- data/lib/active_support/fork_tracker.rb +19 -12
- data/lib/active_support/gem_version.rb +5 -5
- data/lib/active_support/hash_with_indifferent_access.rb +3 -1
- data/lib/active_support/html_safe_translation.rb +43 -0
- data/lib/active_support/i18n.rb +1 -0
- data/lib/active_support/i18n_railtie.rb +1 -1
- data/lib/active_support/inflector/inflections.rb +23 -7
- data/lib/active_support/inflector/methods.rb +29 -55
- data/lib/active_support/inflector/transliterate.rb +1 -1
- data/lib/active_support/isolated_execution_state.rb +72 -0
- data/lib/active_support/json/encoding.rb +3 -3
- data/lib/active_support/key_generator.rb +22 -5
- data/lib/active_support/lazy_load_hooks.rb +28 -4
- data/lib/active_support/locale/en.yml +1 -1
- data/lib/active_support/log_subscriber/test_helper.rb +2 -2
- data/lib/active_support/log_subscriber.rb +15 -5
- data/lib/active_support/logger_thread_safe_level.rb +4 -13
- data/lib/active_support/message_encryptor.rb +12 -6
- data/lib/active_support/message_verifier.rb +46 -14
- data/lib/active_support/messages/metadata.rb +2 -2
- data/lib/active_support/multibyte/chars.rb +10 -11
- data/lib/active_support/multibyte/unicode.rb +0 -12
- data/lib/active_support/multibyte.rb +1 -1
- data/lib/active_support/notifications/fanout.rb +91 -65
- data/lib/active_support/notifications/instrumenter.rb +32 -15
- data/lib/active_support/notifications.rb +23 -23
- data/lib/active_support/number_helper/number_converter.rb +1 -3
- data/lib/active_support/number_helper/number_to_currency_converter.rb +11 -6
- data/lib/active_support/number_helper/number_to_delimited_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_phone_converter.rb +1 -1
- data/lib/active_support/number_helper/rounding_helper.rb +1 -5
- data/lib/active_support/number_helper.rb +4 -5
- data/lib/active_support/option_merger.rb +10 -18
- data/lib/active_support/ordered_hash.rb +1 -1
- data/lib/active_support/ordered_options.rb +1 -1
- data/lib/active_support/parameter_filter.rb +20 -11
- data/lib/active_support/per_thread_registry.rb +5 -0
- data/lib/active_support/railtie.rb +69 -19
- data/lib/active_support/reloader.rb +1 -1
- data/lib/active_support/rescuable.rb +12 -12
- data/lib/active_support/ruby_features.rb +7 -0
- data/lib/active_support/secure_compare_rotator.rb +2 -2
- data/lib/active_support/string_inquirer.rb +0 -2
- data/lib/active_support/subscriber.rb +7 -18
- data/lib/active_support/tagged_logging.rb +2 -2
- data/lib/active_support/test_case.rb +13 -21
- data/lib/active_support/testing/assertions.rb +36 -6
- data/lib/active_support/testing/deprecation.rb +52 -1
- data/lib/active_support/testing/isolation.rb +30 -29
- data/lib/active_support/testing/method_call_assertions.rb +5 -5
- data/lib/active_support/testing/parallelization/server.rb +4 -0
- data/lib/active_support/testing/parallelization/worker.rb +3 -0
- data/lib/active_support/testing/parallelization.rb +4 -0
- data/lib/active_support/testing/parallelize_executor.rb +76 -0
- data/lib/active_support/testing/stream.rb +3 -5
- data/lib/active_support/testing/tagged_logging.rb +1 -1
- data/lib/active_support/testing/time_helpers.rb +13 -2
- data/lib/active_support/time_with_zone.rb +43 -22
- data/lib/active_support/values/time_zone.rb +35 -14
- data/lib/active_support/version.rb +1 -1
- data/lib/active_support/xml_mini/jdom.rb +1 -1
- data/lib/active_support/xml_mini/libxml.rb +5 -5
- data/lib/active_support/xml_mini/libxmlsax.rb +1 -1
- data/lib/active_support/xml_mini/nokogiri.rb +4 -4
- data/lib/active_support/xml_mini/nokogirisax.rb +1 -1
- data/lib/active_support/xml_mini/rexml.rb +1 -1
- data/lib/active_support/xml_mini.rb +5 -4
- data/lib/active_support.rb +17 -1
- metadata +26 -23
- data/lib/active_support/core_ext/marshal.rb +0 -26
- data/lib/active_support/dependencies/zeitwerk_integration.rb +0 -117
data/CHANGELOG.md
CHANGED
@@ -1,650 +1,580 @@
|
|
1
|
-
## Rails
|
1
|
+
## Rails 7.0.8.3 (May 17, 2024) ##
|
2
2
|
|
3
3
|
* No changes.
|
4
4
|
|
5
5
|
|
6
|
-
## Rails
|
6
|
+
## Rails 7.0.8.2 (May 16, 2024) ##
|
7
7
|
|
8
|
-
*
|
8
|
+
* No changes.
|
9
9
|
|
10
|
-
See [#42559](https://github.com/rails/rails/pull/42559).
|
11
10
|
|
12
|
-
|
11
|
+
## Rails 7.0.8.1 (February 21, 2024) ##
|
13
12
|
|
14
|
-
*
|
13
|
+
* No changes.
|
15
14
|
|
16
|
-
Fixes #42302.
|
17
15
|
|
18
|
-
|
16
|
+
## Rails 7.0.8 (September 09, 2023) ##
|
19
17
|
|
20
|
-
*
|
18
|
+
* Fix `TimeWithZone` still using deprecated `#to_s` when `ENV` or `config` to
|
19
|
+
disable it are set.
|
21
20
|
|
22
|
-
*
|
21
|
+
*Hartley McGuire*
|
23
22
|
|
24
|
-
* Fix
|
23
|
+
* Fix CacheStore#write_multi when using a distributed Redis cache with a connection pool.
|
25
24
|
|
26
|
-
|
25
|
+
Fixes [#48938](https://github.com/rails/rails/issues/48938).
|
27
26
|
|
28
|
-
*
|
27
|
+
*Jonathan del Strother*
|
29
28
|
|
30
|
-
*Alex Ghiculescu*
|
31
29
|
|
32
|
-
|
30
|
+
## Rails 7.0.7.2 (August 22, 2023) ##
|
33
31
|
|
34
|
-
|
32
|
+
* No changes.
|
35
33
|
|
36
34
|
|
37
|
-
## Rails
|
35
|
+
## Rails 7.0.7.1 (August 22, 2023) ##
|
38
36
|
|
39
|
-
*
|
37
|
+
* Use a temporary file for storing unencrypted files while editing
|
40
38
|
|
39
|
+
[CVE-2023-38037]
|
41
40
|
|
42
|
-
## Rails 6.1.3.1 (March 26, 2021) ##
|
43
41
|
|
44
|
-
|
42
|
+
## Rails 7.0.7 (August 09, 2023) ##
|
45
43
|
|
44
|
+
* Fix `Cache::NullStore` with local caching for repeated reads.
|
46
45
|
|
47
|
-
|
46
|
+
*fatkodima*
|
48
47
|
|
49
|
-
*
|
48
|
+
* Fix `to_s` with no arguments not respecting custom `:default` formats
|
50
49
|
|
50
|
+
*Hartley McGuire*
|
51
51
|
|
52
|
-
|
52
|
+
* Fix `ActiveSupport::Inflector.humanize(nil)` raising ``NoMethodError: undefined method `end_with?' for nil:NilClass``.
|
53
53
|
|
54
|
-
*
|
54
|
+
*James Robinson*
|
55
55
|
|
56
|
+
* Fix `Enumerable#sum` for `Enumerator#lazy`.
|
56
57
|
|
57
|
-
|
58
|
+
*fatkodima*, *Matthew Draper*, *Jonathan Hefner*
|
58
59
|
|
59
|
-
*
|
60
|
+
* Improve error message when EventedFileUpdateChecker is used without a
|
61
|
+
compatible version of the Listen gem
|
60
62
|
|
61
|
-
|
62
|
-
config.cache_store = :mem_cache_store, nil
|
63
|
+
*Hartley McGuire*
|
63
64
|
|
64
|
-
# is now equivalent to
|
65
65
|
|
66
|
-
|
66
|
+
## Rails 7.0.6 (June 29, 2023) ##
|
67
67
|
|
68
|
-
|
68
|
+
* Fix `EncryptedConfiguration` returning incorrect values for some `Hash`
|
69
|
+
methods
|
69
70
|
|
70
|
-
|
71
|
+
*Hartley McGuire*
|
71
72
|
|
72
|
-
|
73
|
-
```
|
73
|
+
* Fix arguments being destructed `Enumerable#many?` with block.
|
74
74
|
|
75
|
-
|
75
|
+
*Andrew Novoselac*
|
76
76
|
|
77
|
-
|
77
|
+
* Fix humanize for strings ending with id.
|
78
78
|
|
79
|
+
*fatkodima*
|
79
80
|
|
80
|
-
## Rails 6.1.1 (January 07, 2021) ##
|
81
81
|
|
82
|
-
|
83
|
-
instead of the instance variables of the object.
|
82
|
+
## Rails 7.0.5.1 (June 26, 2023) ##
|
84
83
|
|
85
|
-
|
84
|
+
* No changes.
|
86
85
|
|
87
|
-
```ruby
|
88
|
-
IPAddr.new("127.0.0.1").to_json
|
89
|
-
# => "{\"addr\":2130706433,\"family\":2,\"mask_addr\":4294967295}"
|
90
|
-
```
|
91
86
|
|
92
|
-
|
87
|
+
## Rails 7.0.5 (May 24, 2023) ##
|
93
88
|
|
94
|
-
|
95
|
-
IPAddr.new("127.0.0.1").to_json
|
96
|
-
# => "\"127.0.0.1\""
|
97
|
-
```
|
89
|
+
* Fixes TimeWithZone ArgumentError.
|
98
90
|
|
91
|
+
*Niklas Häusele*
|
99
92
|
|
100
|
-
## Rails 6.1.0 (December 09, 2020) ##
|
101
93
|
|
102
|
-
|
103
|
-
`MemoryStore` to its prior rails `5.1` behavior.
|
94
|
+
## Rails 7.0.4.3 (March 13, 2023) ##
|
104
95
|
|
105
|
-
|
96
|
+
* Implement SafeBuffer#bytesplice
|
106
97
|
|
107
|
-
|
108
|
-
digits instead of prepending it.
|
98
|
+
[CVE-2023-28120]
|
109
99
|
|
110
|
-
This change is required so we can interoperate with PostgreSQL, which prefers
|
111
|
-
negative signs for each component.
|
112
100
|
|
113
|
-
|
114
|
-
as negatives per component is still retained.
|
101
|
+
## Rails 7.0.4.2 (January 24, 2023) ##
|
115
102
|
|
116
|
-
|
103
|
+
* No changes.
|
117
104
|
|
118
|
-
(-1.year - 1.day).iso8601
|
119
|
-
# => "-P1Y1D"
|
120
105
|
|
121
|
-
|
106
|
+
## Rails 7.0.4.1 (January 17, 2023) ##
|
122
107
|
|
123
|
-
|
124
|
-
# => "P-1Y-1D"
|
108
|
+
* Avoid regex backtracking in Inflector.underscore
|
125
109
|
|
126
|
-
|
110
|
+
[CVE-2023-22796]
|
127
111
|
|
128
|
-
* Remove deprecated `ActiveSupport::Notifications::Instrumenter#end=`.
|
129
112
|
|
130
|
-
|
113
|
+
## Rails 7.0.4 (September 09, 2022) ##
|
131
114
|
|
132
|
-
*
|
115
|
+
* Ensure `ActiveSupport::Testing::Isolation::Forking` closes pipes
|
133
116
|
|
134
|
-
|
117
|
+
Previously, `Forking.run_in_isolation` opened two ends of a pipe. The fork
|
118
|
+
process closed the read end, wrote to it, and then terminated (which
|
119
|
+
presumably closed the file descriptors on its end). The parent process
|
120
|
+
closed the write end, read from it, and returned, never closing the read
|
121
|
+
end.
|
135
122
|
|
136
|
-
|
137
|
-
|
138
|
-
`ActiveSupport::Multibyte::Unicode.normalize`,
|
139
|
-
`ActiveSupport::Multibyte::Unicode.downcase`,
|
140
|
-
`ActiveSupport::Multibyte::Unicode.upcase` and `ActiveSupport::Multibyte::Unicode.swapcase`.
|
123
|
+
This resulted in an accumulation of open file descriptors, which could
|
124
|
+
cause errors if the limit is reached.
|
141
125
|
|
142
|
-
*
|
126
|
+
*Sam Bostock*
|
143
127
|
|
144
|
-
*
|
128
|
+
* Redis cache store is now compatible with redis-rb 5.0.
|
145
129
|
|
146
|
-
*
|
130
|
+
*Jean Boussier*
|
147
131
|
|
148
|
-
*
|
132
|
+
* Fix `NoMethodError` on custom `ActiveSupport::Deprecation` behavior.
|
149
133
|
|
150
|
-
|
134
|
+
`ActiveSupport::Deprecation.behavior=` was supposed to accept any object
|
135
|
+
that responds to `call`, but in fact its internal implementation assumed that
|
136
|
+
this object could respond to `arity`, so it was restricted to only `Proc` objects.
|
151
137
|
|
152
|
-
|
138
|
+
This change removes this `arity` restriction of custom behaviors.
|
153
139
|
|
154
|
-
*
|
140
|
+
*Ryo Nakamura*
|
155
141
|
|
156
|
-
* Remove deprecated file `active_support/core_ext/hash/compact`.
|
157
142
|
|
158
|
-
|
143
|
+
## Rails 7.0.3.1 (July 12, 2022) ##
|
159
144
|
|
160
|
-
*
|
145
|
+
* No changes.
|
161
146
|
|
162
|
-
*Rafael Mendonça França*
|
163
147
|
|
164
|
-
|
148
|
+
## Rails 7.0.3 (May 09, 2022) ##
|
165
149
|
|
166
|
-
|
150
|
+
* No changes.
|
167
151
|
|
168
|
-
* Remove deprecated file `active_support/core_ext/module/reachable`.
|
169
152
|
|
170
|
-
|
153
|
+
## Rails 7.0.2.4 (April 26, 2022) ##
|
171
154
|
|
172
|
-
*
|
155
|
+
* Fix and add protections for XSS in `ActionView::Helpers` and `ERB::Util`.
|
173
156
|
|
174
|
-
|
157
|
+
Add the method `ERB::Util.xml_name_escape` to escape dangerous characters
|
158
|
+
in names of tags and names of attributes, following the specification of XML.
|
175
159
|
|
176
|
-
|
160
|
+
*Álvaro Martín Fraguas*
|
177
161
|
|
178
|
-
|
162
|
+
## Rails 7.0.2.3 (March 08, 2022) ##
|
179
163
|
|
180
|
-
*
|
164
|
+
* No changes.
|
181
165
|
|
182
|
-
*Rafael Mendonça França*
|
183
166
|
|
184
|
-
|
167
|
+
## Rails 7.0.2.2 (February 11, 2022) ##
|
185
168
|
|
186
|
-
|
169
|
+
* Fix Reloader method signature to work with the new Executor signature
|
187
170
|
|
188
|
-
* Remove entries from local cache on `RedisCacheStore#delete_matched`
|
189
171
|
|
190
|
-
|
172
|
+
## Rails 7.0.2.1 (February 11, 2022) ##
|
191
173
|
|
192
|
-
|
174
|
+
* No changes.
|
193
175
|
|
194
|
-
* Speed up `ActiveSupport::SecurityUtils.fixed_length_secure_compare` by using
|
195
|
-
`OpenSSL.fixed_length_secure_compare`, if available.
|
196
176
|
|
197
|
-
|
177
|
+
## Rails 7.0.2 (February 08, 2022) ##
|
198
178
|
|
199
|
-
* `ActiveSupport::
|
179
|
+
* Fix `ActiveSupport::EncryptedConfiguration` to be compatible with Psych 4
|
200
180
|
|
201
|
-
|
202
|
-
config.cache_store = :mem_cache_store
|
181
|
+
*Stephen Sugden*
|
203
182
|
|
204
|
-
|
183
|
+
* Improve `File.atomic_write` error handling.
|
205
184
|
|
206
|
-
|
185
|
+
*Daniel Pepper*
|
207
186
|
|
208
|
-
# instead of
|
209
187
|
|
210
|
-
|
211
|
-
```
|
188
|
+
## Rails 7.0.1 (January 06, 2022) ##
|
212
189
|
|
213
|
-
|
190
|
+
* Fix `Class#descendants` and `DescendantsTracker#descendants` compatibility with Ruby 3.1.
|
214
191
|
|
215
|
-
|
216
|
-
|
192
|
+
[The native `Class#descendants` was reverted prior to Ruby 3.1 release](https://bugs.ruby-lang.org/issues/14394#note-33),
|
193
|
+
but `Class#subclasses` was kept, breaking the feature detection.
|
217
194
|
|
218
|
-
|
219
|
-
class ActionControllerSubscriber < ActiveSupport::Subscriber
|
220
|
-
attach_to :action_controller
|
195
|
+
*Jean Boussier*
|
221
196
|
|
222
|
-
def start_processing(event)
|
223
|
-
info "Processing by #{event.payload[:controller]}##{event.payload[:action]} as #{format}"
|
224
|
-
end
|
225
197
|
|
226
|
-
|
227
|
-
info { "Redirected to #{event.payload[:location]}" }
|
228
|
-
end
|
229
|
-
end
|
198
|
+
## Rails 7.0.0 (December 15, 2021) ##
|
230
199
|
|
231
|
-
|
232
|
-
# can provide its own instrumentation for certain events in the namespace
|
233
|
-
ActionControllerSubscriber.detach_from(:action_controller)
|
200
|
+
* Fix `ActiveSupport::Duration.build` to support negative values.
|
234
201
|
|
235
|
-
|
236
|
-
|
202
|
+
The algorithm to collect the `parts` of the `ActiveSupport::Duration`
|
203
|
+
ignored the sign of the `value` and accumulated incorrect part values. This
|
204
|
+
impacted `ActiveSupport::Duration#sum` (which is dependent on `parts`) but
|
205
|
+
not `ActiveSupport::Duration#eql?` (which is dependent on `value`).
|
237
206
|
|
238
|
-
|
239
|
-
info "A custom response to start_processing events"
|
240
|
-
end
|
207
|
+
*Caleb Buxton*, *Braden Staudacher*
|
241
208
|
|
242
|
-
# => CustomActionControllerSubscriber will process events for "start_processing.action_controller" notifications
|
243
|
-
# using its own #start_processing implementation, while retaining ActionControllerSubscriber's instrumentation
|
244
|
-
# for "redirect_to.action_controller" notifications
|
245
|
-
end
|
246
|
-
```
|
247
209
|
|
248
|
-
|
210
|
+
## Rails 7.0.0.rc3 (December 14, 2021) ##
|
249
211
|
|
250
|
-
*
|
212
|
+
* No changes.
|
251
213
|
|
252
|
-
`config.active_support.use_sha1_digests` is deprecated in favour of `config.active_support.hash_digest_class = ::Digest::SHA1`.
|
253
214
|
|
254
|
-
|
215
|
+
## Rails 7.0.0.rc2 (December 14, 2021) ##
|
216
|
+
|
217
|
+
* No changes.
|
218
|
+
|
219
|
+
## Rails 7.0.0.rc1 (December 06, 2021) ##
|
220
|
+
|
221
|
+
* Deprecate passing a format to `#to_s` in favor of `#to_formatted_s` in `Array`, `Range`, `Date`, `DateTime`, `Time`,
|
222
|
+
`BigDecimal`, `Float` and, `Integer`.
|
255
223
|
|
256
|
-
*
|
224
|
+
*Rafael Mendonça França*
|
257
225
|
|
258
|
-
|
226
|
+
* Document `ActiveSupport::Testing::Deprecation`.
|
259
227
|
|
260
|
-
*
|
228
|
+
*Sam Bostock & Sam Jordan*
|
261
229
|
|
262
|
-
|
230
|
+
* Add `Pathname#existence`.
|
263
231
|
|
264
|
-
|
232
|
+
```ruby
|
233
|
+
Pathname.new("file").existence&.read
|
234
|
+
```
|
265
235
|
|
266
|
-
*
|
267
|
-
to `read_multi` causing `fetch_multi` to not work properly
|
236
|
+
*Timo Schilling*
|
268
237
|
|
269
|
-
|
238
|
+
* Remove deprecate `ActiveSupport::Multibyte::Unicode.default_normalization_form`.
|
270
239
|
|
271
|
-
*
|
272
|
-
and caused the provided `compression_threshold` to not be respected.
|
240
|
+
*Rafael Mendonça França*
|
273
241
|
|
274
|
-
|
242
|
+
* Remove deprecated support to use `Range#include?` to check the inclusion of a value in
|
243
|
+
a date time range is deprecated.
|
275
244
|
|
276
|
-
*
|
277
|
-
when reading entries written with `raw: true`.
|
245
|
+
*Rafael Mendonça França*
|
278
246
|
|
279
|
-
|
247
|
+
* Remove deprecated `URI.parser`.
|
280
248
|
|
281
|
-
*
|
282
|
-
`URI::DEFAULT_PARSER` instead.
|
249
|
+
*Rafael Mendonça França*
|
283
250
|
|
284
|
-
|
251
|
+
* Remove deprecated `config.active_support.use_sha1_digests`.
|
285
252
|
|
286
|
-
*
|
287
|
-
mode. The method is not deprecated as such (yet), but applications are
|
288
|
-
encouraged to not use it.
|
253
|
+
*Rafael Mendonça França*
|
289
254
|
|
290
|
-
|
291
|
-
|
292
|
-
the constant name is dynamic, camelize if needed, and constantize.
|
255
|
+
* Invoking `Object#with_options` without a `&block` argument returns the
|
256
|
+
`ActiveSupport::OptionMerger` instance.
|
293
257
|
|
294
|
-
*
|
258
|
+
*Sean Doyle*
|
295
259
|
|
296
|
-
*
|
260
|
+
* `Rails.application.executor` hooks can now be called around every test
|
297
261
|
|
298
|
-
|
299
|
-
|
300
|
-
:foo.ends_with?("o") # => true
|
301
|
-
```
|
262
|
+
This helps to better simulate request or job local state being reset around tests and prevents state
|
263
|
+
leaking from one test to another.
|
302
264
|
|
303
|
-
|
265
|
+
However it requires the executor hooks executed in the test environment to be re-entrant.
|
304
266
|
|
305
|
-
|
267
|
+
To enable this, set `config.active_support.executor_around_test_case = true` (this is the default in Rails 7).
|
306
268
|
|
307
|
-
|
308
|
-
where a seemingly innocent change of formatting leads to a change in the code behavior.
|
269
|
+
*Jean Boussier*
|
309
270
|
|
310
|
-
|
311
|
-
```ruby
|
312
|
-
+1.second.class
|
313
|
-
# => ActiveSupport::Duration
|
314
|
-
(+ 1.second).class
|
315
|
-
# => Integer
|
316
|
-
```
|
271
|
+
* `ActiveSupport::DescendantsTracker` now mostly delegate to `Class#descendants` on Ruby 3.1
|
317
272
|
|
318
|
-
|
319
|
-
```ruby
|
320
|
-
+1.second.class
|
321
|
-
# => ActiveSupport::Duration
|
322
|
-
(+ 1.second).class
|
323
|
-
# => ActiveSupport::Duration
|
324
|
-
```
|
273
|
+
Ruby now provides a fast `Class#descendants` making `ActiveSupport::DescendantsTracker` mostly useless.
|
325
274
|
|
326
|
-
|
275
|
+
As a result the following methods are deprecated:
|
327
276
|
|
328
|
-
|
277
|
+
- `ActiveSupport::DescendantsTracker.direct_descendants`
|
278
|
+
- `ActiveSupport::DescendantsTracker#direct_descendants`
|
329
279
|
|
330
|
-
*
|
280
|
+
*Jean Boussier*
|
331
281
|
|
332
|
-
|
282
|
+
* Fix the `Digest::UUID.uuid_from_hash` behavior for namespace IDs that are different from the ones defined on `Digest::UUID`.
|
333
283
|
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
# => "Thu, 22 Jun 2017 02:39:00 UTC +00:00"
|
338
|
-
Time.at(1498099140 + Rational("1/3")).in_time_zone.inspect
|
339
|
-
# => "Thu, 22 Jun 2017 02:39:00 UTC +00:00"
|
284
|
+
The new behavior will be enabled by setting the
|
285
|
+
`config.active_support.use_rfc4122_namespaced_uuids` option to `true`
|
286
|
+
and is the default for new apps.
|
340
287
|
|
341
|
-
|
288
|
+
The old behavior is the default for upgraded apps and will output a
|
289
|
+
deprecation warning every time a value that is different than one of
|
290
|
+
the constants defined on the `Digest::UUID` extension is used as the
|
291
|
+
namespace ID.
|
342
292
|
|
343
|
-
|
344
|
-
# => "Thu, 22 Jun 2017 02:39:00.000000000 UTC +00:00"
|
345
|
-
Time.at(1498099140, 123456780, :nsec).in_time_zone.inspect
|
346
|
-
# => "Thu, 22 Jun 2017 02:39:00.123456780 UTC +00:00"
|
347
|
-
Time.at(1498099140 + Rational("1/3")).in_time_zone.inspect
|
348
|
-
# => "Thu, 22 Jun 2017 02:39:00.333333333 UTC +00:00"
|
293
|
+
*Alex Robbin*, *Erich Soares Machado*, *Eugene Kenny*
|
349
294
|
|
350
|
-
|
295
|
+
* `ActiveSupport::Inflector::Inflections#clear(:acronyms)` is now supported,
|
296
|
+
and `inflector.clear` / `inflector.clear(:all)` also clears acronyms.
|
351
297
|
|
352
|
-
*
|
298
|
+
*Alex Ghiculescu*, *Oliver Peate*
|
353
299
|
|
354
|
-
```ruby
|
355
|
-
logger.tagged("BCX").info("Funky time!") # => [BCX] Funky time!
|
356
|
-
```
|
357
300
|
|
358
|
-
|
301
|
+
## Rails 7.0.0.alpha2 (September 15, 2021) ##
|
302
|
+
|
303
|
+
* No changes.
|
359
304
|
|
360
|
-
* Align `Range#cover?` extension behavior with Ruby behavior for backwards ranges.
|
361
305
|
|
362
|
-
|
306
|
+
## Rails 7.0.0.alpha1 (September 15, 2021) ##
|
363
307
|
|
364
|
-
|
308
|
+
* `ActiveSupport::Dependencies` no longer installs a `const_missing` hook. Before this, you could push to the autoload paths and have constants autoloaded. This feature, known as the `classic` autoloader, has been removed.
|
365
309
|
|
366
|
-
*
|
310
|
+
*Xavier Noria*
|
367
311
|
|
368
|
-
*
|
312
|
+
* Private internal classes of `ActiveSupport::Dependencies` have been deleted, like `ActiveSupport::Dependencies::Reference`, `ActiveSupport::Dependencies::Blamable`, and others.
|
369
313
|
|
370
|
-
|
371
|
-
can be controlled with the
|
372
|
-
`ActiveSupport.utc_to_local_returns_utc_offset_times` config.
|
314
|
+
*Xavier Noria*
|
373
315
|
|
374
|
-
|
375
|
-
via the config in config/initializers/new_framework_defaults_6_1.rb
|
316
|
+
* The private API of `ActiveSupport::Dependencies` has been deleted. That includes methods like `hook!`, `unhook!`, `depend_on`, `require_or_load`, `mechanism`, and many others.
|
376
317
|
|
377
|
-
|
318
|
+
*Xavier Noria*
|
378
319
|
|
379
|
-
|
320
|
+
* Improves the performance of `ActiveSupport::NumberHelper` formatters by avoiding the use of exceptions as flow control.
|
380
321
|
|
381
|
-
*
|
322
|
+
*Mike Dalessio*
|
382
323
|
|
383
|
-
|
324
|
+
* Removed rescue block from `ActiveSupport::Cache::RedisCacheStore#handle_exception`
|
384
325
|
|
385
|
-
|
326
|
+
Previously, if you provided a `error_handler` to `redis_cache_store`, any errors thrown by
|
327
|
+
the error handler would be rescued and logged only. Removed the `rescue` clause from `handle_exception`
|
328
|
+
to allow these to be thrown.
|
386
329
|
|
387
|
-
*
|
330
|
+
*Nicholas A. Stuart*
|
388
331
|
|
389
|
-
|
332
|
+
* Allow entirely opting out of deprecation warnings.
|
390
333
|
|
391
|
-
|
334
|
+
Previously if you did `app.config.active_support.deprecation = :silence`, some work would
|
335
|
+
still be done on each call to `ActiveSupport::Deprecation.warn`. In very hot paths, this could
|
336
|
+
cause performance issues.
|
392
337
|
|
393
|
-
`ActiveSupport::
|
394
|
-
being halted as second argument.
|
395
|
-
This change will allow you to differentiate which callbacks halted the chain
|
396
|
-
and act accordingly.
|
338
|
+
Now, you can make `ActiveSupport::Deprecation.warn` a no-op:
|
397
339
|
|
398
340
|
```ruby
|
399
|
-
|
400
|
-
|
401
|
-
before_create { throw(:abort) }
|
341
|
+
config.active_support.report_deprecations = false
|
342
|
+
```
|
402
343
|
|
403
|
-
|
404
|
-
Rails.logger.info("Book couldn't be #{callback_name}d")
|
405
|
-
end
|
344
|
+
This is the default in production for new apps. It is the equivalent to:
|
406
345
|
|
407
|
-
|
408
|
-
|
409
|
-
|
346
|
+
```ruby
|
347
|
+
config.active_support.deprecation = :silence
|
348
|
+
config.active_support.disallowed_deprecation = :silence
|
410
349
|
```
|
411
350
|
|
412
|
-
|
351
|
+
but will take a more optimised code path.
|
413
352
|
|
414
|
-
*
|
353
|
+
*Alex Ghiculescu*
|
415
354
|
|
416
|
-
|
355
|
+
* Faster tests by parallelizing only when overhead is justified by the number
|
356
|
+
of them.
|
417
357
|
|
418
|
-
|
419
|
-
|
358
|
+
Running tests in parallel adds overhead in terms of database
|
359
|
+
setup and fixture loading. Now, Rails will only parallelize test executions when
|
360
|
+
there are enough tests to make it worth it.
|
420
361
|
|
421
|
-
|
422
|
-
|
423
|
-
end
|
424
|
-
end
|
362
|
+
This threshold is 50 by default, and is configurable via config setting in
|
363
|
+
your test.rb:
|
425
364
|
|
426
|
-
|
427
|
-
|
428
|
-
|
365
|
+
```ruby
|
366
|
+
config.active_support.test_parallelization_threshold = 100
|
367
|
+
```
|
429
368
|
|
430
|
-
|
431
|
-
updated: `concerning :Imposter, prepend: true do`.
|
369
|
+
It's also configurable at the test case level:
|
432
370
|
|
433
|
-
|
371
|
+
```ruby
|
372
|
+
class ActiveSupport::TestCase
|
373
|
+
parallelize threshold: 100
|
374
|
+
end
|
375
|
+
```
|
434
376
|
|
435
|
-
*
|
436
|
-
in a date time range. It is recommended to use `Range#cover?` method
|
437
|
-
instead of `Range#include?` to check the inclusion of a value
|
438
|
-
in a date time range.
|
377
|
+
*Jorge Manrubia*
|
439
378
|
|
440
|
-
|
379
|
+
* OpenSSL constants are now used for Digest computations.
|
441
380
|
|
442
|
-
*
|
381
|
+
*Dirkjan Bussink*
|
443
382
|
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
number_to_rounded(389.32314, precision: 0, round_mode: :ceil) # => "390"
|
448
|
-
number_to_human_size(483989, precision: 2, round_mode: :up) # => "480 KB"
|
449
|
-
number_to_human(489939, precision: 2, round_mode: :floor) # => "480 Thousand"
|
383
|
+
* `TimeZone.iso8601` now accepts valid ordinal values similar to Ruby's `Date._iso8601` method.
|
384
|
+
A valid ordinal value will be converted to an instance of `TimeWithZone` using the `:year`
|
385
|
+
and `:yday` fragments returned from `Date._iso8601`.
|
450
386
|
|
451
|
-
|
387
|
+
```ruby
|
388
|
+
twz = ActiveSupport::TimeZone["Eastern Time (US & Canada)"].iso8601("21087")
|
389
|
+
twz.to_a[0, 6] == [0, 0, 0, 28, 03, 2021]
|
452
390
|
```
|
453
391
|
|
454
|
-
*
|
392
|
+
*Steve Laing*
|
393
|
+
|
394
|
+
* `Time#change` and methods that call it (e.g. `Time#advance`) will now
|
395
|
+
return a `Time` with the timezone argument provided, if the caller was
|
396
|
+
initialized with a timezone argument.
|
397
|
+
|
398
|
+
Fixes [#42467](https://github.com/rails/rails/issues/42467).
|
455
399
|
|
456
|
-
*
|
400
|
+
*Alex Ghiculescu*
|
457
401
|
|
458
|
-
|
402
|
+
* Allow serializing any module or class to JSON by name.
|
459
403
|
|
460
|
-
|
461
|
-
# => true
|
404
|
+
*Tyler Rick*, *Zachary Scott*
|
462
405
|
|
463
|
-
|
406
|
+
* Raise `ActiveSupport::EncryptedFile::MissingKeyError` when the
|
407
|
+
`RAILS_MASTER_KEY` environment variable is blank (e.g. `""`).
|
464
408
|
|
465
|
-
|
466
|
-
# => false
|
409
|
+
*Sunny Ripert*
|
467
410
|
|
468
|
-
|
411
|
+
* The `from:` option is added to `ActiveSupport::TestCase#assert_no_changes`.
|
469
412
|
|
470
|
-
|
471
|
-
This keeps the parser and serializer on the same page.
|
413
|
+
It permits asserting on the initial value that is expected not to change.
|
472
414
|
|
473
415
|
```ruby
|
474
|
-
|
475
|
-
|
416
|
+
assert_no_changes -> { Status.all_good? }, from: true do
|
417
|
+
post :create, params: { status: { ok: true } }
|
418
|
+
end
|
419
|
+
```
|
476
420
|
|
477
|
-
|
478
|
-
# P11DT13H46M40S
|
421
|
+
*George Claghorn*
|
479
422
|
|
480
|
-
|
481
|
-
# 11 days, 13 hours, 46 minutes, and 40 seconds
|
423
|
+
* Deprecate `ActiveSupport::SafeBuffer`'s incorrect implicit conversion of objects into string.
|
482
424
|
|
483
|
-
|
484
|
-
|
425
|
+
Except for a few methods like `String#%`, objects must implement `#to_str`
|
426
|
+
to be implicitly converted to a String in string operations. In some
|
427
|
+
circumstances `ActiveSupport::SafeBuffer` was incorrectly calling the
|
428
|
+
explicit conversion method (`#to_s`) on them. This behavior is now
|
429
|
+
deprecated.
|
485
430
|
|
486
|
-
|
487
|
-
# P1W
|
431
|
+
*Jean Boussier*
|
488
432
|
|
489
|
-
|
490
|
-
# 1 week
|
491
|
-
```
|
433
|
+
* Allow nested access to keys on `Rails.application.credentials`.
|
492
434
|
|
493
|
-
|
435
|
+
Previously only top level keys in `credentials.yml.enc` could be accessed with method calls. Now any key can.
|
494
436
|
|
495
|
-
|
437
|
+
For example, given these secrets:
|
496
438
|
|
497
|
-
|
439
|
+
```yml
|
440
|
+
aws:
|
441
|
+
access_key_id: 123
|
442
|
+
secret_access_key: 345
|
443
|
+
```
|
498
444
|
|
499
|
-
|
500
|
-
`
|
445
|
+
`Rails.application.credentials.aws.access_key_id` will now return the same thing as
|
446
|
+
`Rails.application.credentials.aws[:access_key_id]`.
|
501
447
|
|
502
|
-
*
|
448
|
+
*Alex Ghiculescu*
|
503
449
|
|
504
|
-
*
|
450
|
+
* Added a faster and more compact `ActiveSupport::Cache` serialization format.
|
505
451
|
|
506
|
-
|
452
|
+
It can be enabled with `config.active_support.cache_format_version = 7.0` or
|
453
|
+
`config.load_defaults 7.0`. Regardless of the configuration Active Support
|
454
|
+
7.0 can read cache entries serialized by Active Support 6.1 which allows to
|
455
|
+
upgrade without invalidating the cache. However Rails 6.1 can't read the
|
456
|
+
new format, so all readers must be upgraded before the new format is enabled.
|
507
457
|
|
508
|
-
*
|
509
|
-
and endless range targets.
|
458
|
+
*Jean Boussier*
|
510
459
|
|
511
|
-
|
460
|
+
* Add `Enumerable#sole`, per `ActiveRecord::FinderMethods#sole`. Returns the
|
461
|
+
sole item of the enumerable, raising if no items are found, or if more than
|
462
|
+
one is.
|
512
463
|
|
513
|
-
*
|
464
|
+
*Asherah Connor*
|
514
465
|
|
515
|
-
|
466
|
+
* Freeze `ActiveSupport::Duration#parts` and remove writer methods.
|
516
467
|
|
517
|
-
|
518
|
-
`ActiveSupport::Duration` unless `value` is of type `Numeric`.
|
468
|
+
Durations are meant to be value objects and should not be mutated.
|
519
469
|
|
520
|
-
|
521
|
-
`ActiveSupport::Duration` comparisons would fail confusingly
|
522
|
-
or return unexpected results when comparing durations built from instances of `String`.
|
470
|
+
*Andrew White*
|
523
471
|
|
524
|
-
|
472
|
+
* Fix `ActiveSupport::TimeZone#utc_to_local` with fractional seconds.
|
525
473
|
|
526
|
-
|
527
|
-
|
528
|
-
|
474
|
+
When `utc_to_local_returns_utc_offset_times` is false and the time
|
475
|
+
instance had fractional seconds the new UTC time instance was out by
|
476
|
+
a factor of 1,000,000 as the `Time.utc` constructor takes a usec
|
477
|
+
value and not a fractional second value.
|
529
478
|
|
530
|
-
|
531
|
-
# => false
|
479
|
+
*Andrew White*
|
532
480
|
|
533
|
-
|
534
|
-
# => false
|
481
|
+
* Add `expires_at` argument to `ActiveSupport::Cache` `write` and `fetch` to set a cache entry TTL as an absolute time.
|
535
482
|
|
536
|
-
|
537
|
-
|
483
|
+
```ruby
|
484
|
+
Rails.cache.write(key, value, expires_at: Time.now.at_end_of_hour)
|
485
|
+
```
|
538
486
|
|
539
|
-
|
540
|
-
# => ArgumentError (comparison of String with ActiveSupport::Duration failed)
|
487
|
+
*Jean Boussier*
|
541
488
|
|
542
|
-
|
489
|
+
* Deprecate `ActiveSupport::TimeWithZone.name` so that from Rails 7.1 it will use the default implementation.
|
543
490
|
|
544
|
-
|
545
|
-
# => TypeError (can't build an ActiveSupport::Duration from a String)
|
491
|
+
*Andrew White*
|
546
492
|
|
547
|
-
|
493
|
+
* Deprecates Rails custom `Enumerable#sum` and `Array#sum` in favor of Ruby's native implementation which
|
494
|
+
is considerably faster.
|
548
495
|
|
549
|
-
|
496
|
+
Ruby requires an initializer for non-numeric type as per examples below:
|
550
497
|
|
551
|
-
|
498
|
+
```ruby
|
499
|
+
%w[foo bar].sum('')
|
500
|
+
# instead of %w[foo bar].sum
|
552
501
|
|
553
|
-
|
554
|
-
|
502
|
+
[[1, 2], [3, 4, 5]].sum([])
|
503
|
+
# instead of [[1, 2], [3, 4, 5]].sum
|
504
|
+
```
|
555
505
|
|
556
|
-
*
|
506
|
+
*Alberto Mota*
|
557
507
|
|
558
|
-
*
|
508
|
+
* Tests parallelization is now disabled when running individual files to prevent the setup overhead.
|
559
509
|
|
560
|
-
|
561
|
-
thread_mattr_reader :client, default: Api::Client.new
|
562
|
-
end
|
510
|
+
It can still be enforced if the environment variable `PARALLEL_WORKERS` is present and set to a value greater than 1.
|
563
511
|
|
564
|
-
*
|
512
|
+
*Ricardo Díaz*
|
565
513
|
|
566
|
-
*
|
567
|
-
an Enumerable (also `compact_blank!` on Hash, Array, ActionController::Parameters).
|
514
|
+
* Fix proxying keyword arguments in `ActiveSupport::CurrentAttributes`.
|
568
515
|
|
569
|
-
*
|
516
|
+
*Marcin Kołodziej*
|
570
517
|
|
571
|
-
*
|
518
|
+
* Add `Enumerable#maximum` and `Enumerable#minimum` to easily calculate the maximum or minimum from extracted
|
519
|
+
elements of an enumerable.
|
572
520
|
|
573
|
-
|
574
|
-
|
521
|
+
```ruby
|
522
|
+
payments = [Payment.new(5), Payment.new(15), Payment.new(10)]
|
575
523
|
|
576
|
-
|
524
|
+
payments.minimum(:price) # => 5
|
525
|
+
payments.maximum(:price) # => 15
|
526
|
+
```
|
577
527
|
|
578
|
-
|
579
|
-
|
580
|
-
puts "Main is debug? #{logger.debug?}"
|
528
|
+
This also allows passing enumerables to `fresh_when` and `stale?` in Action Controller.
|
529
|
+
See PR [#41404](https://github.com/rails/rails/pull/41404) for an example.
|
581
530
|
|
582
|
-
|
583
|
-
logger.local_level = 0
|
584
|
-
puts "Thread is debug? #{logger.debug?}"
|
585
|
-
}.resume
|
531
|
+
*Ayrton De Craene*
|
586
532
|
|
587
|
-
|
533
|
+
* `ActiveSupport::Cache::MemCacheStore` now accepts an explicit `nil` for its `addresses` argument.
|
588
534
|
|
589
|
-
|
535
|
+
```ruby
|
536
|
+
config.cache_store = :mem_cache_store, nil
|
590
537
|
|
591
|
-
|
592
|
-
Thread is debug? true
|
593
|
-
Main is debug? true
|
538
|
+
# is now equivalent to
|
594
539
|
|
595
|
-
|
540
|
+
config.cache_store = :mem_cache_store
|
596
541
|
|
597
|
-
|
598
|
-
Thread is debug? true
|
599
|
-
Main is debug? false
|
542
|
+
# and is also equivalent to
|
600
543
|
|
601
|
-
|
544
|
+
config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211"
|
602
545
|
|
603
|
-
|
546
|
+
# which is the fallback behavior of Dalli
|
547
|
+
```
|
604
548
|
|
605
|
-
|
606
|
-
passed at the constructor level.
|
549
|
+
This helps those migrating from `:dalli_store`, where an explicit `nil` was permitted.
|
607
550
|
|
608
|
-
|
551
|
+
*Michael Overmeyer*
|
609
552
|
|
610
|
-
|
611
|
-
crypt.decrypt_and_verify(encrypted_message, on_rotation: proc { ... })
|
612
|
-
crypt.decrypt_and_verify(another_encrypted_message, on_rotation: proc { ... })
|
553
|
+
* Add `Enumerable#in_order_of` to put an Enumerable in a certain order by a key.
|
613
554
|
|
614
|
-
|
555
|
+
*DHH*
|
615
556
|
|
616
|
-
|
617
|
-
|
618
|
-
crypt.decrypt_and_verify(another_encrypted_message)
|
557
|
+
* `ActiveSupport::Inflector.camelize` behaves expected when provided a symbol `:upper` or `:lower` argument. Matches
|
558
|
+
`String#camelize` behavior.
|
619
559
|
|
620
|
-
*
|
560
|
+
*Alex Ghiculescu*
|
621
561
|
|
622
|
-
* `
|
623
|
-
|
624
|
-
the user to specify they want `nil` returned in this case.
|
562
|
+
* Raises an `ArgumentError` when the first argument of `ActiveSupport::Notification.subscribe` is
|
563
|
+
invalid.
|
625
564
|
|
626
|
-
*
|
565
|
+
*Vipul A M*
|
627
566
|
|
628
|
-
* `
|
629
|
-
and a frozen string if it were long enough to be truncated. Now truncate will
|
630
|
-
consistently return an unfrozen string regardless. This behavior is consistent
|
631
|
-
with `gsub` and `strip`.
|
567
|
+
* `HashWithIndifferentAccess#deep_transform_keys` now returns a `HashWithIndifferentAccess` instead of a `Hash`.
|
632
568
|
|
633
|
-
|
569
|
+
*Nathaniel Woodthorpe*
|
634
570
|
|
635
|
-
|
636
|
-
# => true
|
637
|
-
'foobar'.truncate(6).frozen?
|
638
|
-
# => false
|
571
|
+
* Consume dalli’s `cache_nils` configuration as `ActiveSupport::Cache`'s `skip_nil` when using `MemCacheStore`.
|
639
572
|
|
640
|
-
|
573
|
+
*Ritikesh G*
|
641
574
|
|
642
|
-
|
643
|
-
# => false
|
644
|
-
'foobar'.truncate(6).frozen?
|
645
|
-
# => false
|
575
|
+
* Add `RedisCacheStore#stats` method similar to `MemCacheStore#stats`. Calls `redis#info` internally.
|
646
576
|
|
647
|
-
*
|
577
|
+
*Ritikesh G*
|
648
578
|
|
649
579
|
|
650
|
-
Please check [6-
|
580
|
+
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/activesupport/CHANGELOG.md) for previous changes.
|