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