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