activesupport 7.0.8 → 7.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +134 -446
- data/MIT-LICENSE +1 -1
- data/README.rdoc +4 -4
- data/lib/active_support/actionable_error.rb +3 -1
- data/lib/active_support/array_inquirer.rb +3 -1
- data/lib/active_support/backtrace_cleaner.rb +39 -7
- data/lib/active_support/benchmarkable.rb +1 -0
- data/lib/active_support/broadcast_logger.rb +251 -0
- data/lib/active_support/builder.rb +1 -1
- data/lib/active_support/cache/coder.rb +153 -0
- data/lib/active_support/cache/entry.rb +134 -0
- data/lib/active_support/cache/file_store.rb +49 -17
- data/lib/active_support/cache/mem_cache_store.rb +94 -128
- data/lib/active_support/cache/memory_store.rb +80 -25
- data/lib/active_support/cache/null_store.rb +6 -0
- data/lib/active_support/cache/redis_cache_store.rb +165 -152
- data/lib/active_support/cache/serializer_with_fallback.rb +152 -0
- data/lib/active_support/cache/strategy/local_cache.rb +29 -14
- data/lib/active_support/cache.rb +363 -291
- data/lib/active_support/callbacks.rb +118 -134
- data/lib/active_support/code_generator.rb +15 -10
- data/lib/active_support/concern.rb +4 -2
- data/lib/active_support/concurrency/load_interlock_aware_monitor.rb +42 -3
- data/lib/active_support/concurrency/null_lock.rb +13 -0
- data/lib/active_support/configurable.rb +10 -0
- data/lib/active_support/core_ext/array/conversions.rb +1 -2
- data/lib/active_support/core_ext/array.rb +0 -1
- data/lib/active_support/core_ext/class/subclasses.rb +17 -34
- data/lib/active_support/core_ext/date/blank.rb +4 -0
- data/lib/active_support/core_ext/date/conversions.rb +1 -2
- data/lib/active_support/core_ext/date.rb +0 -1
- data/lib/active_support/core_ext/date_and_time/calculations.rb +10 -0
- data/lib/active_support/core_ext/date_and_time/compatibility.rb +28 -1
- data/lib/active_support/core_ext/date_time/blank.rb +4 -0
- data/lib/active_support/core_ext/date_time/conversions.rb +2 -2
- data/lib/active_support/core_ext/date_time.rb +0 -1
- data/lib/active_support/core_ext/digest/uuid.rb +7 -10
- data/lib/active_support/core_ext/enumerable.rb +3 -75
- data/lib/active_support/core_ext/erb/util.rb +201 -0
- data/lib/active_support/core_ext/hash/conversions.rb +1 -1
- data/lib/active_support/core_ext/hash/deep_merge.rb +22 -14
- data/lib/active_support/core_ext/hash/keys.rb +4 -4
- data/lib/active_support/core_ext/module/attr_internal.rb +17 -6
- data/lib/active_support/core_ext/module/attribute_accessors.rb +6 -0
- data/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb +34 -16
- data/lib/active_support/core_ext/module/concerning.rb +6 -6
- data/lib/active_support/core_ext/module/delegation.rb +20 -119
- data/lib/active_support/core_ext/module/deprecation.rb +12 -12
- data/lib/active_support/core_ext/module/introspection.rb +0 -1
- data/lib/active_support/core_ext/numeric/bytes.rb +9 -0
- data/lib/active_support/core_ext/numeric/conversions.rb +5 -3
- data/lib/active_support/core_ext/numeric.rb +0 -1
- data/lib/active_support/core_ext/object/blank.rb +45 -1
- data/lib/active_support/core_ext/object/deep_dup.rb +16 -0
- data/lib/active_support/core_ext/object/duplicable.rb +24 -15
- data/lib/active_support/core_ext/object/inclusion.rb +13 -5
- data/lib/active_support/core_ext/object/instance_variables.rb +4 -2
- data/lib/active_support/core_ext/object/json.rb +12 -4
- data/lib/active_support/core_ext/object/with.rb +46 -0
- data/lib/active_support/core_ext/object/with_options.rb +4 -4
- data/lib/active_support/core_ext/object.rb +1 -0
- data/lib/active_support/core_ext/pathname/blank.rb +20 -0
- data/lib/active_support/core_ext/pathname/existence.rb +2 -0
- data/lib/active_support/core_ext/pathname.rb +1 -0
- data/lib/active_support/core_ext/range/conversions.rb +28 -7
- data/lib/active_support/core_ext/range/overlap.rb +40 -0
- data/lib/active_support/core_ext/range.rb +1 -2
- data/lib/active_support/core_ext/securerandom.rb +1 -5
- data/lib/active_support/core_ext/string/conversions.rb +1 -1
- data/lib/active_support/core_ext/string/filters.rb +21 -15
- data/lib/active_support/core_ext/string/indent.rb +1 -1
- data/lib/active_support/core_ext/string/inflections.rb +16 -5
- data/lib/active_support/core_ext/string/output_safety.rb +34 -177
- data/lib/active_support/core_ext/thread/backtrace/location.rb +12 -0
- data/lib/active_support/core_ext/time/calculations.rb +36 -30
- data/lib/active_support/core_ext/time/compatibility.rb +16 -0
- data/lib/active_support/core_ext/time/conversions.rb +1 -3
- data/lib/active_support/core_ext/time/zones.rb +4 -4
- data/lib/active_support/core_ext/time.rb +0 -1
- data/lib/active_support/core_ext.rb +0 -1
- data/lib/active_support/current_attributes.rb +48 -46
- data/lib/active_support/deep_mergeable.rb +53 -0
- data/lib/active_support/delegation.rb +202 -0
- data/lib/active_support/dependencies/autoload.rb +9 -16
- data/lib/active_support/deprecation/behaviors.rb +65 -42
- data/lib/active_support/deprecation/constant_accessor.rb +47 -25
- data/lib/active_support/deprecation/deprecators.rb +104 -0
- data/lib/active_support/deprecation/disallowed.rb +3 -5
- data/lib/active_support/deprecation/method_wrappers.rb +6 -23
- data/lib/active_support/deprecation/proxy_wrappers.rb +34 -22
- data/lib/active_support/deprecation/reporting.rb +48 -26
- data/lib/active_support/deprecation.rb +39 -9
- data/lib/active_support/deprecator.rb +7 -0
- data/lib/active_support/descendants_tracker.rb +66 -172
- data/lib/active_support/duration/iso8601_parser.rb +2 -2
- data/lib/active_support/duration/iso8601_serializer.rb +1 -4
- data/lib/active_support/duration.rb +13 -7
- data/lib/active_support/encrypted_configuration.rb +30 -9
- data/lib/active_support/encrypted_file.rb +8 -3
- data/lib/active_support/environment_inquirer.rb +22 -2
- data/lib/active_support/error_reporter/test_helper.rb +15 -0
- data/lib/active_support/error_reporter.rb +160 -36
- data/lib/active_support/evented_file_update_checker.rb +0 -1
- data/lib/active_support/execution_wrapper.rb +4 -5
- data/lib/active_support/file_update_checker.rb +5 -3
- data/lib/active_support/fork_tracker.rb +4 -32
- data/lib/active_support/gem_version.rb +3 -3
- data/lib/active_support/gzip.rb +2 -0
- data/lib/active_support/hash_with_indifferent_access.rb +41 -25
- data/lib/active_support/html_safe_translation.rb +19 -6
- data/lib/active_support/i18n.rb +1 -1
- data/lib/active_support/i18n_railtie.rb +20 -13
- data/lib/active_support/inflector/inflections.rb +2 -0
- data/lib/active_support/inflector/methods.rb +23 -11
- data/lib/active_support/inflector/transliterate.rb +3 -1
- data/lib/active_support/isolated_execution_state.rb +26 -22
- data/lib/active_support/json/decoding.rb +2 -1
- data/lib/active_support/json/encoding.rb +25 -43
- data/lib/active_support/key_generator.rb +9 -1
- data/lib/active_support/lazy_load_hooks.rb +6 -4
- data/lib/active_support/locale/en.yml +2 -0
- data/lib/active_support/log_subscriber.rb +74 -34
- data/lib/active_support/logger.rb +22 -60
- data/lib/active_support/logger_thread_safe_level.rb +10 -32
- data/lib/active_support/message_encryptor.rb +197 -53
- data/lib/active_support/message_encryptors.rb +141 -0
- data/lib/active_support/message_pack/cache_serializer.rb +23 -0
- data/lib/active_support/message_pack/extensions.rb +305 -0
- data/lib/active_support/message_pack/serializer.rb +63 -0
- data/lib/active_support/message_pack.rb +50 -0
- data/lib/active_support/message_verifier.rb +220 -89
- data/lib/active_support/message_verifiers.rb +135 -0
- data/lib/active_support/messages/codec.rb +65 -0
- data/lib/active_support/messages/metadata.rb +111 -45
- data/lib/active_support/messages/rotation_coordinator.rb +93 -0
- data/lib/active_support/messages/rotator.rb +34 -32
- data/lib/active_support/messages/serializer_with_fallback.rb +158 -0
- data/lib/active_support/multibyte/chars.rb +4 -2
- data/lib/active_support/multibyte/unicode.rb +9 -37
- data/lib/active_support/notifications/fanout.rb +248 -87
- data/lib/active_support/notifications/instrumenter.rb +93 -25
- data/lib/active_support/notifications.rb +29 -28
- data/lib/active_support/number_helper/number_converter.rb +16 -7
- data/lib/active_support/number_helper/number_to_currency_converter.rb +6 -6
- data/lib/active_support/number_helper/number_to_human_size_converter.rb +3 -3
- data/lib/active_support/number_helper/number_to_phone_converter.rb +1 -0
- data/lib/active_support/number_helper.rb +379 -318
- data/lib/active_support/option_merger.rb +2 -2
- data/lib/active_support/ordered_hash.rb +3 -3
- data/lib/active_support/ordered_options.rb +67 -15
- data/lib/active_support/parameter_filter.rb +84 -69
- data/lib/active_support/proxy_object.rb +8 -3
- data/lib/active_support/railtie.rb +25 -20
- data/lib/active_support/reloader.rb +12 -4
- data/lib/active_support/rescuable.rb +2 -0
- data/lib/active_support/secure_compare_rotator.rb +16 -9
- data/lib/active_support/string_inquirer.rb +4 -2
- data/lib/active_support/subscriber.rb +9 -27
- data/lib/active_support/syntax_error_proxy.rb +60 -0
- data/lib/active_support/tagged_logging.rb +64 -25
- data/lib/active_support/test_case.rb +156 -7
- data/lib/active_support/testing/assertions.rb +28 -12
- data/lib/active_support/testing/autorun.rb +0 -2
- data/lib/active_support/testing/constant_stubbing.rb +54 -0
- data/lib/active_support/testing/deprecation.rb +20 -27
- data/lib/active_support/testing/error_reporter_assertions.rb +107 -0
- data/lib/active_support/testing/isolation.rb +19 -9
- data/lib/active_support/testing/method_call_assertions.rb +7 -8
- data/lib/active_support/testing/parallelize_executor.rb +8 -3
- data/lib/active_support/testing/setup_and_teardown.rb +2 -0
- data/lib/active_support/testing/stream.rb +1 -1
- data/lib/active_support/testing/strict_warnings.rb +40 -0
- data/lib/active_support/testing/tests_without_assertions.rb +19 -0
- data/lib/active_support/testing/time_helpers.rb +38 -16
- data/lib/active_support/time_with_zone.rb +11 -17
- data/lib/active_support/values/time_zone.rb +19 -8
- data/lib/active_support/version.rb +1 -1
- data/lib/active_support/xml_mini/jdom.rb +3 -10
- data/lib/active_support/xml_mini/nokogiri.rb +1 -1
- 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 +12 -3
- data/lib/active_support.rb +15 -3
- metadata +128 -21
- data/lib/active_support/core_ext/array/deprecated_conversions.rb +0 -25
- data/lib/active_support/core_ext/date/deprecated_conversions.rb +0 -40
- data/lib/active_support/core_ext/date_time/deprecated_conversions.rb +0 -36
- data/lib/active_support/core_ext/numeric/deprecated_conversions.rb +0 -60
- data/lib/active_support/core_ext/range/deprecated_conversions.rb +0 -36
- data/lib/active_support/core_ext/range/include_time_with_zone.rb +0 -5
- data/lib/active_support/core_ext/range/overlaps.rb +0 -10
- data/lib/active_support/core_ext/time/deprecated_conversions.rb +0 -73
- data/lib/active_support/core_ext/uri.rb +0 -5
- data/lib/active_support/deprecation/instance_delegator.rb +0 -38
- data/lib/active_support/per_thread_registry.rb +0 -65
- data/lib/active_support/ruby_features.rb +0 -7
data/CHANGELOG.md
CHANGED
@@ -1,565 +1,253 @@
|
|
1
|
-
## Rails 7.0
|
1
|
+
## Rails 7.2.0 (August 09, 2024) ##
|
2
2
|
|
3
|
-
* Fix `
|
4
|
-
disable it are set.
|
3
|
+
* Fix `delegate_missing_to allow_nil: true` when called with implict self
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
Fixes [#48938](https://github.com/rails/rails/issues/48938).
|
11
|
-
|
12
|
-
*Jonathan del Strother*
|
13
|
-
|
14
|
-
|
15
|
-
## Rails 7.0.7.2 (August 22, 2023) ##
|
16
|
-
|
17
|
-
* No changes.
|
18
|
-
|
19
|
-
|
20
|
-
## Rails 7.0.7.1 (August 22, 2023) ##
|
21
|
-
|
22
|
-
* Use a temporary file for storing unencrypted files while editing
|
23
|
-
|
24
|
-
[CVE-2023-38037]
|
25
|
-
|
26
|
-
|
27
|
-
## Rails 7.0.7 (August 09, 2023) ##
|
28
|
-
|
29
|
-
* Fix `Cache::NullStore` with local caching for repeated reads.
|
30
|
-
|
31
|
-
*fatkodima*
|
32
|
-
|
33
|
-
* Fix `to_s` with no arguments not respecting custom `:default` formats
|
34
|
-
|
35
|
-
*Hartley McGuire*
|
36
|
-
|
37
|
-
* Fix `ActiveSupport::Inflector.humanize(nil)` raising ``NoMethodError: undefined method `end_with?' for nil:NilClass``.
|
38
|
-
|
39
|
-
*James Robinson*
|
40
|
-
|
41
|
-
* Fix `Enumerable#sum` for `Enumerator#lazy`.
|
42
|
-
|
43
|
-
*fatkodima*, *Matthew Draper*, *Jonathan Hefner*
|
44
|
-
|
45
|
-
* Improve error message when EventedFileUpdateChecker is used without a
|
46
|
-
compatible version of the Listen gem
|
47
|
-
|
48
|
-
*Hartley McGuire*
|
49
|
-
|
50
|
-
|
51
|
-
## Rails 7.0.6 (June 29, 2023) ##
|
52
|
-
|
53
|
-
* Fix `EncryptedConfiguration` returning incorrect values for some `Hash`
|
54
|
-
methods
|
55
|
-
|
56
|
-
*Hartley McGuire*
|
57
|
-
|
58
|
-
* Fix arguments being destructed `Enumerable#many?` with block.
|
59
|
-
|
60
|
-
*Andrew Novoselac*
|
61
|
-
|
62
|
-
* Fix humanize for strings ending with id.
|
63
|
-
|
64
|
-
*fatkodima*
|
65
|
-
|
66
|
-
|
67
|
-
## Rails 7.0.5.1 (June 26, 2023) ##
|
68
|
-
|
69
|
-
* No changes.
|
70
|
-
|
71
|
-
|
72
|
-
## Rails 7.0.5 (May 24, 2023) ##
|
73
|
-
|
74
|
-
* Fixes TimeWithZone ArgumentError.
|
75
|
-
|
76
|
-
*Niklas Häusele*
|
77
|
-
|
78
|
-
|
79
|
-
## Rails 7.0.4.3 (March 13, 2023) ##
|
80
|
-
|
81
|
-
* Implement SafeBuffer#bytesplice
|
82
|
-
|
83
|
-
[CVE-2023-28120]
|
84
|
-
|
85
|
-
|
86
|
-
## Rails 7.0.4.2 (January 24, 2023) ##
|
87
|
-
|
88
|
-
* No changes.
|
89
|
-
|
90
|
-
|
91
|
-
## Rails 7.0.4.1 (January 17, 2023) ##
|
92
|
-
|
93
|
-
* Avoid regex backtracking in Inflector.underscore
|
94
|
-
|
95
|
-
[CVE-2023-22796]
|
96
|
-
|
97
|
-
|
98
|
-
## Rails 7.0.4 (September 09, 2022) ##
|
99
|
-
|
100
|
-
* Ensure `ActiveSupport::Testing::Isolation::Forking` closes pipes
|
101
|
-
|
102
|
-
Previously, `Forking.run_in_isolation` opened two ends of a pipe. The fork
|
103
|
-
process closed the read end, wrote to it, and then terminated (which
|
104
|
-
presumably closed the file descriptors on its end). The parent process
|
105
|
-
closed the write end, read from it, and returned, never closing the read
|
106
|
-
end.
|
5
|
+
```ruby
|
6
|
+
class Person
|
7
|
+
delegate_missing_to :address, allow_nil: true
|
107
8
|
|
108
|
-
|
109
|
-
|
9
|
+
def address
|
10
|
+
nil
|
11
|
+
end
|
110
12
|
|
111
|
-
|
13
|
+
def berliner?
|
14
|
+
city == "Berlin"
|
15
|
+
end
|
16
|
+
end
|
112
17
|
|
113
|
-
|
18
|
+
Person.new.city # => nil
|
19
|
+
Person.new.berliner? # undefined local variable or method `city' for an instance of Person (NameError)
|
20
|
+
```
|
114
21
|
|
115
22
|
*Jean Boussier*
|
116
23
|
|
117
|
-
*
|
118
|
-
|
119
|
-
`ActiveSupport::Deprecation.behavior=` was supposed to accept any object
|
120
|
-
that responds to `call`, but in fact its internal implementation assumed that
|
121
|
-
this object could respond to `arity`, so it was restricted to only `Proc` objects.
|
122
|
-
|
123
|
-
This change removes this `arity` restriction of custom behaviors.
|
124
|
-
|
125
|
-
*Ryo Nakamura*
|
126
|
-
|
127
|
-
|
128
|
-
## Rails 7.0.3.1 (July 12, 2022) ##
|
129
|
-
|
130
|
-
* No changes.
|
131
|
-
|
132
|
-
|
133
|
-
## Rails 7.0.3 (May 09, 2022) ##
|
134
|
-
|
135
|
-
* No changes.
|
136
|
-
|
137
|
-
|
138
|
-
## Rails 7.0.2.4 (April 26, 2022) ##
|
139
|
-
|
140
|
-
* Fix and add protections for XSS in `ActionView::Helpers` and `ERB::Util`.
|
141
|
-
|
142
|
-
Add the method `ERB::Util.xml_name_escape` to escape dangerous characters
|
143
|
-
in names of tags and names of attributes, following the specification of XML.
|
24
|
+
* Add `logger` as a dependency since it is a bundled gem candidate for Ruby 3.5
|
144
25
|
|
145
|
-
|
26
|
+
*Earlopain*
|
146
27
|
|
147
|
-
|
28
|
+
* Define `Digest::UUID.nil_uuid`, which returns the so-called nil UUID.
|
148
29
|
|
149
|
-
*
|
150
|
-
|
151
|
-
|
152
|
-
## Rails 7.0.2.2 (February 11, 2022) ##
|
153
|
-
|
154
|
-
* Fix Reloader method signature to work with the new Executor signature
|
155
|
-
|
156
|
-
|
157
|
-
## Rails 7.0.2.1 (February 11, 2022) ##
|
158
|
-
|
159
|
-
* No changes.
|
160
|
-
|
161
|
-
|
162
|
-
## Rails 7.0.2 (February 08, 2022) ##
|
163
|
-
|
164
|
-
* Fix `ActiveSupport::EncryptedConfiguration` to be compatible with Psych 4
|
165
|
-
|
166
|
-
*Stephen Sugden*
|
167
|
-
|
168
|
-
* Improve `File.atomic_write` error handling.
|
169
|
-
|
170
|
-
*Daniel Pepper*
|
171
|
-
|
172
|
-
|
173
|
-
## Rails 7.0.1 (January 06, 2022) ##
|
174
|
-
|
175
|
-
* Fix `Class#descendants` and `DescendantsTracker#descendants` compatibility with Ruby 3.1.
|
176
|
-
|
177
|
-
[The native `Class#descendants` was reverted prior to Ruby 3.1 release](https://bugs.ruby-lang.org/issues/14394#note-33),
|
178
|
-
but `Class#subclasses` was kept, breaking the feature detection.
|
30
|
+
*Xavier Noria*
|
179
31
|
|
180
|
-
|
32
|
+
* Support `duration` type in `ActiveSupport::XmlMini`.
|
181
33
|
|
34
|
+
*heka1024*
|
182
35
|
|
183
|
-
|
36
|
+
* Remove deprecated `ActiveSupport::Notifications::Event#children` and `ActiveSupport::Notifications::Event#parent_of?`.
|
184
37
|
|
185
|
-
*
|
38
|
+
*Rafael Mendonça França*
|
186
39
|
|
187
|
-
|
188
|
-
ignored the sign of the `value` and accumulated incorrect part values. This
|
189
|
-
impacted `ActiveSupport::Duration#sum` (which is dependent on `parts`) but
|
190
|
-
not `ActiveSupport::Duration#eql?` (which is dependent on `value`).
|
40
|
+
* Remove deprecated support to call the following methods without passing a deprecator:
|
191
41
|
|
192
|
-
|
42
|
+
- `deprecate`
|
43
|
+
- `deprecate_constant`
|
44
|
+
- `ActiveSupport::Deprecation::DeprecatedObjectProxy.new`
|
45
|
+
- `ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.new`
|
46
|
+
- `ActiveSupport::Deprecation::DeprecatedConstantProxy.new`
|
47
|
+
- `assert_deprecated`
|
48
|
+
- `assert_not_deprecated`
|
49
|
+
- `collect_deprecations`
|
193
50
|
|
51
|
+
*Rafael Mendonça França*
|
194
52
|
|
195
|
-
|
53
|
+
* Remove deprecated `ActiveSupport::Deprecation` delegation to instance.
|
196
54
|
|
197
|
-
*
|
55
|
+
*Rafael Mendonça França*
|
198
56
|
|
57
|
+
* Remove deprecated `SafeBuffer#clone_empty`.
|
199
58
|
|
200
|
-
|
59
|
+
*Rafael Mendonça França*
|
201
60
|
|
202
|
-
*
|
61
|
+
* Remove deprecated `#to_default_s` from `Array`, `Date`, `DateTime` and `Time`.
|
203
62
|
|
204
|
-
|
63
|
+
*Rafael Mendonça França*
|
205
64
|
|
206
|
-
*
|
207
|
-
`BigDecimal`, `Float` and, `Integer`.
|
65
|
+
* Remove deprecated support to passing `Dalli::Client` instances to `MemCacheStore`.
|
208
66
|
|
209
67
|
*Rafael Mendonça França*
|
210
68
|
|
211
|
-
*
|
212
|
-
|
213
|
-
*Sam Bostock & Sam Jordan*
|
69
|
+
* Remove deprecated `config.active_support.use_rfc4122_namespaced_uuids`.
|
214
70
|
|
215
|
-
*
|
71
|
+
*Rafael Mendonça França*
|
216
72
|
|
217
|
-
|
218
|
-
Pathname.new("file").existence&.read
|
219
|
-
```
|
73
|
+
* Remove deprecated `config.active_support.remove_deprecated_time_with_zone_name`.
|
220
74
|
|
221
|
-
*
|
75
|
+
*Rafael Mendonça França*
|
222
76
|
|
223
|
-
* Remove
|
77
|
+
* Remove deprecated `config.active_support.disable_to_s_conversion`.
|
224
78
|
|
225
79
|
*Rafael Mendonça França*
|
226
80
|
|
227
|
-
* Remove deprecated support to
|
228
|
-
a date time range is deprecated.
|
81
|
+
* Remove deprecated support to bolding log text with positional boolean in `ActiveSupport::LogSubscriber#color`.
|
229
82
|
|
230
83
|
*Rafael Mendonça França*
|
231
84
|
|
232
|
-
* Remove deprecated `
|
85
|
+
* Remove deprecated constants `ActiveSupport::LogSubscriber::CLEAR` and `ActiveSupport::LogSubscriber::BOLD`.
|
233
86
|
|
234
87
|
*Rafael Mendonça França*
|
235
88
|
|
236
|
-
* Remove deprecated `config.active_support.
|
89
|
+
* Remove deprecated support for `config.active_support.cache_format_version = 6.1`.
|
237
90
|
|
238
91
|
*Rafael Mendonça França*
|
239
92
|
|
240
|
-
*
|
241
|
-
`ActiveSupport::OptionMerger` instance.
|
93
|
+
* Remove deprecated `:pool_size` and `:pool_timeout` options for the cache storage.
|
242
94
|
|
243
|
-
*
|
244
|
-
|
245
|
-
* `Rails.application.executor` hooks can now be called around every test
|
95
|
+
*Rafael Mendonça França*
|
246
96
|
|
247
|
-
|
248
|
-
leaking from one test to another.
|
97
|
+
* Warn on tests without assertions.
|
249
98
|
|
250
|
-
|
99
|
+
`ActiveSupport::TestCase` now warns when tests do not run any assertions.
|
100
|
+
This is helpful in detecting broken tests that do not perform intended assertions.
|
251
101
|
|
252
|
-
|
102
|
+
*fatkodima*
|
253
103
|
|
254
|
-
|
104
|
+
* Support `hexBinary` type in `ActiveSupport::XmlMini`.
|
255
105
|
|
256
|
-
*
|
106
|
+
*heka1024*
|
257
107
|
|
258
|
-
|
108
|
+
* Deprecate `ActiveSupport::ProxyObject` in favor of Ruby's built-in `BasicObject`.
|
259
109
|
|
260
|
-
|
110
|
+
*Earlopain*
|
261
111
|
|
262
|
-
|
263
|
-
- `ActiveSupport::DescendantsTracker#direct_descendants`
|
112
|
+
* `stub_const` now accepts a `exists: false` parameter to allow stubbing missing constants.
|
264
113
|
|
265
114
|
*Jean Boussier*
|
266
115
|
|
267
|
-
*
|
268
|
-
|
269
|
-
The new behavior will be enabled by setting the
|
270
|
-
`config.active_support.use_rfc4122_namespaced_uuids` option to `true`
|
271
|
-
and is the default for new apps.
|
272
|
-
|
273
|
-
The old behavior is the default for upgraded apps and will output a
|
274
|
-
deprecation warning every time a value that is different than one of
|
275
|
-
the constants defined on the `Digest::UUID` extension is used as the
|
276
|
-
namespace ID.
|
277
|
-
|
278
|
-
*Alex Robbin*, *Erich Soares Machado*, *Eugene Kenny*
|
279
|
-
|
280
|
-
* `ActiveSupport::Inflector::Inflections#clear(:acronyms)` is now supported,
|
281
|
-
and `inflector.clear` / `inflector.clear(:all)` also clears acronyms.
|
282
|
-
|
283
|
-
*Alex Ghiculescu*, *Oliver Peate*
|
284
|
-
|
285
|
-
|
286
|
-
## Rails 7.0.0.alpha2 (September 15, 2021) ##
|
287
|
-
|
288
|
-
* No changes.
|
289
|
-
|
290
|
-
|
291
|
-
## Rails 7.0.0.alpha1 (September 15, 2021) ##
|
292
|
-
|
293
|
-
* `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.
|
294
|
-
|
295
|
-
*Xavier Noria*
|
296
|
-
|
297
|
-
* Private internal classes of `ActiveSupport::Dependencies` have been deleted, like `ActiveSupport::Dependencies::Reference`, `ActiveSupport::Dependencies::Blamable`, and others.
|
298
|
-
|
299
|
-
*Xavier Noria*
|
116
|
+
* Make `ActiveSupport::BacktraceCleaner` copy filters and silencers on dup and clone.
|
300
117
|
|
301
|
-
|
118
|
+
Previously the copy would still share the internal silencers and filters array,
|
119
|
+
causing state to leak.
|
302
120
|
|
303
|
-
*
|
304
|
-
|
305
|
-
* Improves the performance of `ActiveSupport::NumberHelper` formatters by avoiding the use of exceptions as flow control.
|
306
|
-
|
307
|
-
*Mike Dalessio*
|
308
|
-
|
309
|
-
* Removed rescue block from `ActiveSupport::Cache::RedisCacheStore#handle_exception`
|
310
|
-
|
311
|
-
Previously, if you provided a `error_handler` to `redis_cache_store`, any errors thrown by
|
312
|
-
the error handler would be rescued and logged only. Removed the `rescue` clause from `handle_exception`
|
313
|
-
to allow these to be thrown.
|
314
|
-
|
315
|
-
*Nicholas A. Stuart*
|
316
|
-
|
317
|
-
* Allow entirely opting out of deprecation warnings.
|
318
|
-
|
319
|
-
Previously if you did `app.config.active_support.deprecation = :silence`, some work would
|
320
|
-
still be done on each call to `ActiveSupport::Deprecation.warn`. In very hot paths, this could
|
321
|
-
cause performance issues.
|
121
|
+
*Jean Boussier*
|
322
122
|
|
323
|
-
|
123
|
+
* Updating Astana with Western Kazakhstan TZInfo identifier.
|
324
124
|
|
325
|
-
|
326
|
-
config.active_support.report_deprecations = false
|
327
|
-
```
|
125
|
+
*Damian Nelson*
|
328
126
|
|
329
|
-
|
127
|
+
* Add filename support for `ActiveSupport::Logger.logger_outputs_to?`.
|
330
128
|
|
331
129
|
```ruby
|
332
|
-
|
333
|
-
|
130
|
+
logger = Logger.new('/var/log/rails.log')
|
131
|
+
ActiveSupport::Logger.logger_outputs_to?(logger, '/var/log/rails.log')
|
334
132
|
```
|
335
133
|
|
336
|
-
|
337
|
-
|
338
|
-
*Alex Ghiculescu*
|
134
|
+
*Christian Schmidt*
|
339
135
|
|
340
|
-
*
|
341
|
-
|
136
|
+
* Include `IPAddr#prefix` when serializing an `IPAddr` using the
|
137
|
+
`ActiveSupport::MessagePack` serializer.
|
342
138
|
|
343
|
-
|
344
|
-
|
345
|
-
there are enough tests to make it worth it.
|
139
|
+
This change is backward and forward compatible — old payloads can
|
140
|
+
still be read, and new payloads will be readable by older versions of Rails.
|
346
141
|
|
347
|
-
|
348
|
-
your test.rb:
|
142
|
+
*Taiki Komaba*
|
349
143
|
|
350
|
-
|
351
|
-
config.active_support.test_parallelization_threshold = 100
|
352
|
-
```
|
353
|
-
|
354
|
-
It's also configurable at the test case level:
|
144
|
+
* Add `default:` support for `ActiveSupport::CurrentAttributes.attribute`.
|
355
145
|
|
356
146
|
```ruby
|
357
|
-
class ActiveSupport::
|
358
|
-
|
147
|
+
class Current < ActiveSupport::CurrentAttributes
|
148
|
+
attribute :counter, default: 0
|
359
149
|
end
|
360
150
|
```
|
361
151
|
|
362
|
-
*
|
363
|
-
|
364
|
-
* OpenSSL constants are now used for Digest computations.
|
365
|
-
|
366
|
-
*Dirkjan Bussink*
|
152
|
+
*Sean Doyle*
|
367
153
|
|
368
|
-
*
|
369
|
-
A valid ordinal value will be converted to an instance of `TimeWithZone` using the `:year`
|
370
|
-
and `:yday` fragments returned from `Date._iso8601`.
|
154
|
+
* Yield instance to `Object#with` block.
|
371
155
|
|
372
156
|
```ruby
|
373
|
-
|
374
|
-
|
157
|
+
client.with(timeout: 5_000) do |c|
|
158
|
+
c.get("/commits")
|
159
|
+
end
|
375
160
|
```
|
376
161
|
|
377
|
-
*
|
378
|
-
|
379
|
-
* `Time#change` and methods that call it (e.g. `Time#advance`) will now
|
380
|
-
return a `Time` with the timezone argument provided, if the caller was
|
381
|
-
initialized with a timezone argument.
|
382
|
-
|
383
|
-
Fixes [#42467](https://github.com/rails/rails/issues/42467).
|
162
|
+
*Sean Doyle*
|
384
163
|
|
385
|
-
|
164
|
+
* Use logical core count instead of physical core count to determine the
|
165
|
+
default number of workers when parallelizing tests.
|
386
166
|
|
387
|
-
*
|
167
|
+
*Jonathan Hefner*
|
388
168
|
|
389
|
-
|
169
|
+
* Fix `Time.now/DateTime.now/Date.today` to return results in a system timezone after `#travel_to`.
|
390
170
|
|
391
|
-
|
392
|
-
|
171
|
+
There is a bug in the current implementation of #travel_to:
|
172
|
+
it remembers a timezone of its argument, and all stubbed methods start
|
173
|
+
returning results in that remembered timezone. However, the expected
|
174
|
+
behavior is to return results in a system timezone.
|
393
175
|
|
394
|
-
*
|
176
|
+
*Aleksei Chernenkov*
|
395
177
|
|
396
|
-
*
|
178
|
+
* Add `ErrorReported#unexpected` to report precondition violations.
|
397
179
|
|
398
|
-
|
180
|
+
For example:
|
399
181
|
|
400
182
|
```ruby
|
401
|
-
|
402
|
-
|
183
|
+
def edit
|
184
|
+
if published?
|
185
|
+
Rails.error.unexpected("[BUG] Attempting to edit a published article, that shouldn't be possible")
|
186
|
+
return false
|
187
|
+
end
|
188
|
+
# ...
|
403
189
|
end
|
404
190
|
```
|
405
191
|
|
406
|
-
|
407
|
-
|
408
|
-
* Deprecate `ActiveSupport::SafeBuffer`'s incorrect implicit conversion of objects into string.
|
409
|
-
|
410
|
-
Except for a few methods like `String#%`, objects must implement `#to_str`
|
411
|
-
to be implicitly converted to a String in string operations. In some
|
412
|
-
circumstances `ActiveSupport::SafeBuffer` was incorrectly calling the
|
413
|
-
explicit conversion method (`#to_s`) on them. This behavior is now
|
414
|
-
deprecated.
|
415
|
-
|
416
|
-
*Jean Boussier*
|
417
|
-
|
418
|
-
* Allow nested access to keys on `Rails.application.credentials`.
|
419
|
-
|
420
|
-
Previously only top level keys in `credentials.yml.enc` could be accessed with method calls. Now any key can.
|
421
|
-
|
422
|
-
For example, given these secrets:
|
423
|
-
|
424
|
-
```yml
|
425
|
-
aws:
|
426
|
-
access_key_id: 123
|
427
|
-
secret_access_key: 345
|
428
|
-
```
|
429
|
-
|
430
|
-
`Rails.application.credentials.aws.access_key_id` will now return the same thing as
|
431
|
-
`Rails.application.credentials.aws[:access_key_id]`.
|
432
|
-
|
433
|
-
*Alex Ghiculescu*
|
434
|
-
|
435
|
-
* Added a faster and more compact `ActiveSupport::Cache` serialization format.
|
436
|
-
|
437
|
-
It can be enabled with `config.active_support.cache_format_version = 7.0` or
|
438
|
-
`config.load_defaults 7.0`. Regardless of the configuration Active Support
|
439
|
-
7.0 can read cache entries serialized by Active Support 6.1 which allows to
|
440
|
-
upgrade without invalidating the cache. However Rails 6.1 can't read the
|
441
|
-
new format, so all readers must be upgraded before the new format is enabled.
|
192
|
+
The above will raise an error in development and test, but only report the error in production.
|
442
193
|
|
443
194
|
*Jean Boussier*
|
444
195
|
|
445
|
-
*
|
446
|
-
sole item of the enumerable, raising if no items are found, or if more than
|
447
|
-
one is.
|
448
|
-
|
449
|
-
*Asherah Connor*
|
450
|
-
|
451
|
-
* Freeze `ActiveSupport::Duration#parts` and remove writer methods.
|
196
|
+
* Make the order of read_multi and write_multi notifications for `Cache::Store#fetch_multi` operations match the order they are executed in.
|
452
197
|
|
453
|
-
|
198
|
+
*Adam Renberg Tamm*
|
454
199
|
|
455
|
-
|
200
|
+
* Make return values of `Cache::Store#write` consistent.
|
456
201
|
|
457
|
-
|
202
|
+
The return value was not specified before. Now it returns `true` on a successful write,
|
203
|
+
`nil` if there was an error talking to the cache backend, and `false` if the write failed
|
204
|
+
for another reason (e.g. the key already exists and `unless_exist: true` was passed).
|
458
205
|
|
459
|
-
|
460
|
-
instance had fractional seconds the new UTC time instance was out by
|
461
|
-
a factor of 1,000,000 as the `Time.utc` constructor takes a usec
|
462
|
-
value and not a fractional second value.
|
206
|
+
*Sander Verdonschot*
|
463
207
|
|
464
|
-
|
465
|
-
|
466
|
-
* Add `expires_at` argument to `ActiveSupport::Cache` `write` and `fetch` to set a cache entry TTL as an absolute time.
|
467
|
-
|
468
|
-
```ruby
|
469
|
-
Rails.cache.write(key, value, expires_at: Time.now.at_end_of_hour)
|
470
|
-
```
|
471
|
-
|
472
|
-
*Jean Boussier*
|
473
|
-
|
474
|
-
* Deprecate `ActiveSupport::TimeWithZone.name` so that from Rails 7.1 it will use the default implementation.
|
475
|
-
|
476
|
-
*Andrew White*
|
477
|
-
|
478
|
-
* Deprecates Rails custom `Enumerable#sum` and `Array#sum` in favor of Ruby's native implementation which
|
479
|
-
is considerably faster.
|
480
|
-
|
481
|
-
Ruby requires an initializer for non-numeric type as per examples below:
|
482
|
-
|
483
|
-
```ruby
|
484
|
-
%w[foo bar].sum('')
|
485
|
-
# instead of %w[foo bar].sum
|
208
|
+
* Fix logged cache keys not always matching actual key used by cache action.
|
486
209
|
|
487
|
-
|
488
|
-
# instead of [[1, 2], [3, 4, 5]].sum
|
489
|
-
```
|
490
|
-
|
491
|
-
*Alberto Mota*
|
492
|
-
|
493
|
-
* Tests parallelization is now disabled when running individual files to prevent the setup overhead.
|
494
|
-
|
495
|
-
It can still be enforced if the environment variable `PARALLEL_WORKERS` is present and set to a value greater than 1.
|
496
|
-
|
497
|
-
*Ricardo Díaz*
|
498
|
-
|
499
|
-
* Fix proxying keyword arguments in `ActiveSupport::CurrentAttributes`.
|
500
|
-
|
501
|
-
*Marcin Kołodziej*
|
502
|
-
|
503
|
-
* Add `Enumerable#maximum` and `Enumerable#minimum` to easily calculate the maximum or minimum from extracted
|
504
|
-
elements of an enumerable.
|
505
|
-
|
506
|
-
```ruby
|
507
|
-
payments = [Payment.new(5), Payment.new(15), Payment.new(10)]
|
508
|
-
|
509
|
-
payments.minimum(:price) # => 5
|
510
|
-
payments.maximum(:price) # => 15
|
511
|
-
```
|
512
|
-
|
513
|
-
This also allows passing enumerables to `fresh_when` and `stale?` in Action Controller.
|
514
|
-
See PR [#41404](https://github.com/rails/rails/pull/41404) for an example.
|
515
|
-
|
516
|
-
*Ayrton De Craene*
|
517
|
-
|
518
|
-
* `ActiveSupport::Cache::MemCacheStore` now accepts an explicit `nil` for its `addresses` argument.
|
519
|
-
|
520
|
-
```ruby
|
521
|
-
config.cache_store = :mem_cache_store, nil
|
522
|
-
|
523
|
-
# is now equivalent to
|
524
|
-
|
525
|
-
config.cache_store = :mem_cache_store
|
210
|
+
*Hartley McGuire*
|
526
211
|
|
527
|
-
|
212
|
+
* Improve error messages of `assert_changes` and `assert_no_changes`.
|
528
213
|
|
529
|
-
|
214
|
+
`assert_changes` error messages now display objects with `.inspect` to make it easier
|
215
|
+
to differentiate nil from empty strings, strings from symbols, etc.
|
216
|
+
`assert_no_changes` error messages now surface the actual value.
|
530
217
|
|
531
|
-
|
532
|
-
```
|
218
|
+
*pcreux*
|
533
219
|
|
534
|
-
|
220
|
+
* Fix `#to_fs(:human_size)` to correctly work with negative numbers.
|
535
221
|
|
536
|
-
*
|
222
|
+
*Earlopain*
|
537
223
|
|
538
|
-
*
|
224
|
+
* Fix `BroadcastLogger#dup` so that it duplicates the logger's `broadcasts`.
|
539
225
|
|
540
|
-
*
|
226
|
+
*Andrew Novoselac*
|
541
227
|
|
542
|
-
* `
|
543
|
-
`String#camelize` behavior.
|
228
|
+
* Fix issue where `bootstrap.rb` overwrites the `level` of a `BroadcastLogger`'s `broadcasts`.
|
544
229
|
|
545
|
-
*
|
230
|
+
*Andrew Novoselac*
|
546
231
|
|
547
|
-
*
|
548
|
-
invalid.
|
232
|
+
* Fix compatibility with the `semantic_logger` gem.
|
549
233
|
|
550
|
-
|
234
|
+
The `semantic_logger` gem doesn't behave exactly like stdlib logger in that
|
235
|
+
`SemanticLogger#level` returns a Symbol while stdlib `Logger#level` returns an Integer.
|
551
236
|
|
552
|
-
|
237
|
+
This caused the various `LogSubscriber` classes in Rails to break when assigned a
|
238
|
+
`SemanticLogger` instance.
|
553
239
|
|
554
|
-
*
|
240
|
+
*Jean Boussier*, *ojab*
|
555
241
|
|
556
|
-
*
|
242
|
+
* Fix MemoryStore to prevent race conditions when incrementing or decrementing.
|
557
243
|
|
558
|
-
*
|
244
|
+
*Pierre Jambet*
|
559
245
|
|
560
|
-
*
|
246
|
+
* Implement `HashWithIndifferentAccess#to_proc`.
|
561
247
|
|
562
|
-
|
248
|
+
Previously, calling `#to_proc` on `HashWithIndifferentAccess` object used inherited `#to_proc`
|
249
|
+
method from the `Hash` class, which was not able to access values using indifferent keys.
|
563
250
|
|
251
|
+
*fatkodima*
|
564
252
|
|
565
|
-
Please check [
|
253
|
+
Please check [7-1-stable](https://github.com/rails/rails/blob/7-1-stable/activesupport/CHANGELOG.md) for previous changes.
|