activesupport 6.0.4.4 → 7.0.4.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.
Potentially problematic release.
This version of activesupport might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +257 -532
- data/MIT-LICENSE +1 -1
- data/lib/active_support/actionable_error.rb +1 -1
- data/lib/active_support/array_inquirer.rb +2 -2
- data/lib/active_support/backtrace_cleaner.rb +5 -5
- data/lib/active_support/benchmarkable.rb +3 -3
- data/lib/active_support/cache/file_store.rb +16 -10
- data/lib/active_support/cache/mem_cache_store.rb +163 -42
- data/lib/active_support/cache/memory_store.rb +57 -29
- data/lib/active_support/cache/null_store.rb +10 -2
- data/lib/active_support/cache/redis_cache_store.rb +79 -98
- data/lib/active_support/cache/strategy/local_cache.rb +49 -57
- data/lib/active_support/cache.rb +378 -179
- data/lib/active_support/callbacks.rb +230 -122
- data/lib/active_support/code_generator.rb +65 -0
- data/lib/active_support/concern.rb +49 -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 +9 -6
- data/lib/active_support/configuration_file.rb +51 -0
- 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/benchmark.rb +2 -2
- data/lib/active_support/core_ext/big_decimal/conversions.rb +1 -1
- data/lib/active_support/core_ext/class/attribute.rb +34 -44
- data/lib/active_support/core_ext/class/subclasses.rb +9 -22
- data/lib/active_support/core_ext/date/blank.rb +1 -1
- data/lib/active_support/core_ext/date/calculations.rb +9 -9
- data/lib/active_support/core_ext/date/conversions.rb +16 -15
- 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 +17 -4
- data/lib/active_support/core_ext/date_and_time/compatibility.rb +15 -0
- data/lib/active_support/core_ext/date_time/blank.rb +1 -1
- 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 -13
- data/lib/active_support/core_ext/enumerable.rb +164 -23
- data/lib/active_support/core_ext/file/atomic.rb +3 -1
- data/lib/active_support/core_ext/hash/conversions.rb +2 -3
- data/lib/active_support/core_ext/hash/deep_transform_values.rb +1 -1
- data/lib/active_support/core_ext/hash/indifferent_access.rb +3 -3
- data/lib/active_support/core_ext/hash/keys.rb +2 -2
- data/lib/active_support/core_ext/hash/slice.rb +3 -2
- 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/load_error.rb +1 -1
- data/lib/active_support/core_ext/module/attr_internal.rb +2 -2
- data/lib/active_support/core_ext/module/attribute_accessors.rb +25 -29
- data/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb +26 -13
- data/lib/active_support/core_ext/module/concerning.rb +8 -2
- data/lib/active_support/core_ext/module/delegation.rb +40 -36
- data/lib/active_support/core_ext/module/introspection.rb +1 -25
- data/lib/active_support/core_ext/name_error.rb +23 -2
- data/lib/active_support/core_ext/numeric/conversions.rb +80 -73
- 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 +11 -0
- data/lib/active_support/core_ext/object/json.rb +42 -26
- data/lib/active_support/core_ext/object/to_query.rb +2 -2
- data/lib/active_support/core_ext/object/try.rb +20 -20
- data/lib/active_support/core_ext/object/with_options.rb +20 -1
- 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 +6 -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 +4 -20
- 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/regexp.rb +8 -1
- data/lib/active_support/core_ext/securerandom.rb +1 -1
- data/lib/active_support/core_ext/string/access.rb +5 -24
- data/lib/active_support/core_ext/string/conversions.rb +3 -2
- data/lib/active_support/core_ext/string/filters.rb +1 -1
- data/lib/active_support/core_ext/string/inflections.rb +39 -5
- data/lib/active_support/core_ext/string/inquiry.rb +2 -1
- data/lib/active_support/core_ext/string/multibyte.rb +2 -2
- data/lib/active_support/core_ext/string/output_safety.rb +92 -41
- data/lib/active_support/core_ext/string/starts_ends_with.rb +2 -2
- data/lib/active_support/core_ext/symbol/starts_ends_with.rb +6 -0
- data/lib/active_support/core_ext/symbol.rb +3 -0
- data/lib/active_support/core_ext/time/calculations.rb +25 -7
- data/lib/active_support/core_ext/time/conversions.rb +15 -12
- data/lib/active_support/core_ext/time/deprecated_conversions.rb +22 -0
- data/lib/active_support/core_ext/time/zones.rb +7 -22
- data/lib/active_support/core_ext/time.rb +1 -0
- data/lib/active_support/core_ext/uri.rb +3 -23
- data/lib/active_support/core_ext.rb +2 -1
- data/lib/active_support/current_attributes/test_helper.rb +13 -0
- data/lib/active_support/current_attributes.rb +39 -16
- 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 -769
- data/lib/active_support/deprecation/behaviors.rb +23 -7
- data/lib/active_support/deprecation/disallowed.rb +56 -0
- data/lib/active_support/deprecation/instance_delegator.rb +0 -1
- data/lib/active_support/deprecation/method_wrappers.rb +6 -5
- data/lib/active_support/deprecation/proxy_wrappers.rb +4 -4
- data/lib/active_support/deprecation/reporting.rb +50 -7
- data/lib/active_support/deprecation.rb +7 -2
- data/lib/active_support/descendants_tracker.rb +174 -64
- data/lib/active_support/digest.rb +5 -3
- data/lib/active_support/duration/iso8601_parser.rb +3 -3
- data/lib/active_support/duration/iso8601_serializer.rb +24 -10
- data/lib/active_support/duration.rb +134 -55
- data/lib/active_support/encrypted_configuration.rb +13 -2
- data/lib/active_support/encrypted_file.rb +32 -3
- data/lib/active_support/environment_inquirer.rb +20 -0
- data/lib/active_support/error_reporter.rb +117 -0
- data/lib/active_support/evented_file_update_checker.rb +72 -138
- data/lib/active_support/execution_context/test_helper.rb +13 -0
- data/lib/active_support/execution_context.rb +53 -0
- data/lib/active_support/execution_wrapper.rb +43 -21
- data/lib/active_support/executor/test_helper.rb +7 -0
- data/lib/active_support/fork_tracker.rb +71 -0
- data/lib/active_support/gem_version.rb +3 -3
- data/lib/active_support/hash_with_indifferent_access.rb +51 -25
- 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 +14 -19
- data/lib/active_support/inflector/inflections.rb +24 -9
- data/lib/active_support/inflector/methods.rb +29 -49
- data/lib/active_support/inflector/transliterate.rb +5 -5
- data/lib/active_support/isolated_execution_state.rb +72 -0
- data/lib/active_support/json/decoding.rb +4 -4
- data/lib/active_support/json/encoding.rb +8 -4
- data/lib/active_support/key_generator.rb +23 -6
- data/lib/active_support/lazy_load_hooks.rb +28 -4
- data/lib/active_support/locale/en.yml +8 -4
- data/lib/active_support/log_subscriber/test_helper.rb +2 -2
- data/lib/active_support/log_subscriber.rb +23 -5
- data/lib/active_support/logger.rb +1 -1
- data/lib/active_support/logger_silence.rb +2 -26
- data/lib/active_support/logger_thread_safe_level.rb +34 -21
- data/lib/active_support/message_encryptor.rb +16 -13
- data/lib/active_support/message_verifier.rb +50 -18
- data/lib/active_support/messages/metadata.rb +2 -2
- data/lib/active_support/messages/rotation_configuration.rb +2 -1
- data/lib/active_support/messages/rotator.rb +6 -5
- data/lib/active_support/multibyte/chars.rb +13 -52
- data/lib/active_support/multibyte/unicode.rb +1 -87
- data/lib/active_support/multibyte.rb +1 -1
- data/lib/active_support/notifications/fanout.rb +110 -69
- data/lib/active_support/notifications/instrumenter.rb +37 -29
- data/lib/active_support/notifications.rb +55 -28
- data/lib/active_support/number_helper/number_converter.rb +2 -4
- 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_converter.rb +1 -1
- data/lib/active_support/number_helper/number_to_human_size_converter.rb +2 -2
- data/lib/active_support/number_helper/number_to_phone_converter.rb +1 -1
- data/lib/active_support/number_helper/number_to_rounded_converter.rb +9 -5
- data/lib/active_support/number_helper/rounding_helper.rb +12 -32
- data/lib/active_support/number_helper.rb +29 -16
- data/lib/active_support/option_merger.rb +11 -18
- data/lib/active_support/ordered_hash.rb +1 -1
- data/lib/active_support/ordered_options.rb +9 -3
- data/lib/active_support/parameter_filter.rb +21 -11
- data/lib/active_support/per_thread_registry.rb +6 -1
- data/lib/active_support/rails.rb +1 -4
- data/lib/active_support/railtie.rb +77 -5
- data/lib/active_support/reloader.rb +1 -1
- data/lib/active_support/rescuable.rb +16 -16
- data/lib/active_support/ruby_features.rb +7 -0
- data/lib/active_support/secure_compare_rotator.rb +51 -0
- data/lib/active_support/security_utils.rb +19 -12
- data/lib/active_support/string_inquirer.rb +2 -2
- data/lib/active_support/subscriber.rb +19 -25
- data/lib/active_support/tagged_logging.rb +31 -6
- data/lib/active_support/test_case.rb +13 -21
- data/lib/active_support/testing/assertions.rb +50 -13
- data/lib/active_support/testing/deprecation.rb +52 -1
- data/lib/active_support/testing/isolation.rb +2 -2
- data/lib/active_support/testing/method_call_assertions.rb +5 -5
- data/lib/active_support/testing/parallelization/server.rb +82 -0
- data/lib/active_support/testing/parallelization/worker.rb +103 -0
- data/lib/active_support/testing/parallelization.rb +16 -95
- 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 +53 -5
- data/lib/active_support/time_with_zone.rb +126 -62
- data/lib/active_support/values/time_zone.rb +54 -23
- 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 +9 -2
- data/lib/active_support/xml_mini.rb +5 -4
- data/lib/active_support.rb +29 -1
- metadata +46 -45
- data/lib/active_support/core_ext/array/prepend_and_append.rb +0 -5
- data/lib/active_support/core_ext/hash/compact.rb +0 -5
- data/lib/active_support/core_ext/hash/transform_values.rb +0 -5
- data/lib/active_support/core_ext/marshal.rb +0 -24
- data/lib/active_support/core_ext/module/reachable.rb +0 -6
- data/lib/active_support/core_ext/numeric/inquiry.rb +0 -5
- data/lib/active_support/core_ext/range/include_range.rb +0 -9
- data/lib/active_support/dependencies/zeitwerk_integration.rb +0 -117
data/CHANGELOG.md
CHANGED
@@ -1,737 +1,462 @@
|
|
1
|
-
## Rails
|
2
|
-
|
3
|
-
* No changes.
|
4
|
-
|
5
|
-
|
6
|
-
## Rails 6.0.4.3 (December 14, 2021) ##
|
7
|
-
|
8
|
-
* No changes.
|
1
|
+
## Rails 7.0.4.1 (January 17, 2023) ##
|
9
2
|
|
3
|
+
* Avoid regex backtracking in Inflector.underscore
|
10
4
|
|
11
|
-
|
5
|
+
[CVE-2023-22796]
|
12
6
|
|
13
|
-
* No changes.
|
14
|
-
|
15
|
-
|
16
|
-
## Rails 6.0.4.1 (August 19, 2021) ##
|
17
|
-
|
18
|
-
* No changes.
|
19
7
|
|
8
|
+
## Rails 7.0.4 (September 09, 2022) ##
|
20
9
|
|
21
|
-
|
10
|
+
* Redis cache store is now compatible with redis-rb 5.0.
|
22
11
|
|
23
|
-
*
|
24
|
-
to `read_multi` causing `fetch_multi` to not work properly.
|
12
|
+
*Jean Boussier*
|
25
13
|
|
26
|
-
|
14
|
+
* Fix `NoMethodError` on custom `ActiveSupport::Deprecation` behavior.
|
27
15
|
|
28
|
-
|
16
|
+
`ActiveSupport::Deprecation.behavior=` was supposed to accept any object
|
17
|
+
that responds to `call`, but in fact its internal implementation assumed that
|
18
|
+
this object could respond to `arity`, so it was restricted to only `Proc` objects.
|
29
19
|
|
30
|
-
|
20
|
+
This change removes this `arity` restriction of custom behaviors.
|
31
21
|
|
32
|
-
*
|
22
|
+
*Ryo Nakamura*
|
33
23
|
|
34
24
|
|
35
|
-
## Rails
|
25
|
+
## Rails 7.0.3.1 (July 12, 2022) ##
|
36
26
|
|
37
27
|
* No changes.
|
38
28
|
|
39
29
|
|
40
|
-
## Rails
|
30
|
+
## Rails 7.0.3 (May 09, 2022) ##
|
41
31
|
|
42
32
|
* No changes.
|
43
33
|
|
44
34
|
|
45
|
-
## Rails
|
35
|
+
## Rails 7.0.2.4 (April 26, 2022) ##
|
46
36
|
|
47
|
-
*
|
37
|
+
* Fix and add protections for XSS in `ActionView::Helpers` and `ERB::Util`.
|
38
|
+
|
39
|
+
Add the method `ERB::Util.xml_name_escape` to escape dangerous characters
|
40
|
+
in names of tags and names of attributes, following the specification of XML.
|
48
41
|
|
42
|
+
*Álvaro Martín Fraguas*
|
49
43
|
|
50
|
-
## Rails
|
44
|
+
## Rails 7.0.2.3 (March 08, 2022) ##
|
51
45
|
|
52
46
|
* No changes.
|
53
47
|
|
54
48
|
|
55
|
-
## Rails
|
49
|
+
## Rails 7.0.2.2 (February 11, 2022) ##
|
56
50
|
|
57
|
-
*
|
51
|
+
* Fix Reloader method signature to work with the new Executor signature
|
58
52
|
|
59
53
|
|
60
|
-
## Rails
|
54
|
+
## Rails 7.0.2.1 (February 11, 2022) ##
|
61
55
|
|
62
56
|
* No changes.
|
63
57
|
|
64
58
|
|
65
|
-
## Rails
|
59
|
+
## Rails 7.0.2 (February 08, 2022) ##
|
66
60
|
|
67
|
-
*
|
61
|
+
* Fix `ActiveSupport::EncryptedConfiguration` to be compatible with Psych 4
|
68
62
|
|
69
|
-
*
|
63
|
+
*Stephen Sugden*
|
70
64
|
|
65
|
+
* Improve `File.atomic_write` error handling.
|
71
66
|
|
72
|
-
|
67
|
+
*Daniel Pepper*
|
73
68
|
|
74
|
-
* `Array#to_sentence` no longer returns a frozen string.
|
75
69
|
|
76
|
-
|
70
|
+
## Rails 7.0.1 (January 06, 2022) ##
|
77
71
|
|
78
|
-
|
79
|
-
# => true
|
72
|
+
* Fix `Class#descendants` and `DescendantsTracker#descendants` compatibility with Ruby 3.1.
|
80
73
|
|
81
|
-
|
74
|
+
[The native `Class#descendants` was reverted prior to Ruby 3.1 release](https://bugs.ruby-lang.org/issues/14394#note-33),
|
75
|
+
but `Class#subclasses` was kept, breaking the feature detection.
|
82
76
|
|
83
|
-
|
84
|
-
# => false
|
77
|
+
*Jean Boussier*
|
85
78
|
|
86
|
-
*Nicolas Dular*
|
87
79
|
|
88
|
-
|
89
|
-
`ActiveSupport.parse_json_times = true`.
|
80
|
+
## Rails 7.0.0 (December 15, 2021) ##
|
90
81
|
|
91
|
-
|
82
|
+
* Fix `ActiveSupport::Duration.build` to support negative values.
|
92
83
|
|
84
|
+
The algorithm to collect the `parts` of the `ActiveSupport::Duration`
|
85
|
+
ignored the sign of the `value` and accumulated incorrect part values. This
|
86
|
+
impacted `ActiveSupport::Duration#sum` (which is dependent on `parts`) but
|
87
|
+
not `ActiveSupport::Duration#eql?` (which is dependent on `value`).
|
93
88
|
|
94
|
-
|
95
|
-
|
96
|
-
* No changes.
|
89
|
+
*Caleb Buxton*, *Braden Staudacher*
|
97
90
|
|
98
91
|
|
99
|
-
## Rails
|
92
|
+
## Rails 7.0.0.rc3 (December 14, 2021) ##
|
100
93
|
|
101
94
|
* No changes.
|
102
95
|
|
103
96
|
|
104
|
-
## Rails
|
105
|
-
|
106
|
-
* Eager load translations during initialization.
|
107
|
-
|
108
|
-
*Diego Plentz*
|
109
|
-
|
110
|
-
* Use per-thread CPU time clock on `ActiveSupport::Notifications`.
|
111
|
-
|
112
|
-
*George Claghorn*
|
113
|
-
|
97
|
+
## Rails 7.0.0.rc2 (December 14, 2021) ##
|
114
98
|
|
115
|
-
|
116
|
-
|
117
|
-
* `ActiveSupport::SafeBuffer` supports `Enumerator` methods.
|
99
|
+
* No changes.
|
118
100
|
|
119
|
-
|
101
|
+
## Rails 7.0.0.rc1 (December 06, 2021) ##
|
120
102
|
|
121
|
-
*
|
122
|
-
|
103
|
+
* Deprecate passing a format to `#to_s` in favor of `#to_formatted_s` in `Array`, `Range`, `Date`, `DateTime`, `Time`,
|
104
|
+
`BigDecimal`, `Float` and, `Integer`.
|
123
105
|
|
124
|
-
*
|
106
|
+
*Rafael Mendonça França*
|
125
107
|
|
126
|
-
*
|
127
|
-
unexpectedly change the cached value.
|
108
|
+
* Document `ActiveSupport::Testing::Deprecation`.
|
128
109
|
|
129
|
-
*
|
110
|
+
*Sam Bostock & Sam Jordan*
|
130
111
|
|
131
|
-
*
|
112
|
+
* Add `Pathname#existence`.
|
132
113
|
|
133
114
|
```ruby
|
134
|
-
|
135
|
-
Rails.autoloaders.each do |autoloader|
|
136
|
-
autoloader.inflector.inflect(
|
137
|
-
"html_parser" => "HTMLParser",
|
138
|
-
"ssl_error" => "SSLError"
|
139
|
-
)
|
140
|
-
end
|
115
|
+
Pathname.new("file").existence&.read
|
141
116
|
```
|
142
117
|
|
143
|
-
That way, you can tweak how individual basenames are inflected without touching Active Support inflection rules, which are global. These inflectors fallback to `String#camelize`, so existing inflection rules are still taken into account for non-overridden basenames.
|
144
|
-
|
145
|
-
Please, check the [autoloading guide for `zeitwerk` mode](https://guides.rubyonrails.org/v6.0/autoloading_and_reloading_constants.html#customizing-inflections) if you prefer not to depend on `String#camelize` at all.
|
146
|
-
|
147
|
-
*Xavier Noria*
|
148
|
-
|
149
|
-
* Improve `Range#===`, `Range#include?`, and `Range#cover?` to work with beginless (startless)
|
150
|
-
and endless range targets.
|
151
|
-
|
152
|
-
*Allen Hsu*, *Andrew Hodgkinson*
|
153
|
-
|
154
|
-
* Don't use `Process#clock_gettime(CLOCK_THREAD_CPUTIME_ID)` on Solaris.
|
155
|
-
|
156
|
-
*Iain Beeston*
|
157
|
-
|
158
|
-
|
159
|
-
## Rails 6.0.0 (August 16, 2019) ##
|
160
|
-
|
161
|
-
* Let `require_dependency` in `zeitwerk` mode look the autoload paths up for
|
162
|
-
better backwards compatibility.
|
163
|
-
|
164
|
-
*Xavier Noria*
|
165
|
-
|
166
|
-
* Let `require_dependency` in `zeitwerk` mode support arguments that respond
|
167
|
-
to `to_path` for better backwards compatibility.
|
168
|
-
|
169
|
-
*Xavier Noria*
|
170
|
-
|
171
|
-
* Make ActiveSupport::Logger Fiber-safe. Fixes #36752.
|
172
|
-
|
173
|
-
Use `Fiber.current.__id__` in `ActiveSupport::Logger#local_level=` in order
|
174
|
-
to make log level local to Ruby Fibers in addition to Threads.
|
175
|
-
|
176
|
-
Example:
|
177
|
-
|
178
|
-
logger = ActiveSupport::Logger.new(STDOUT)
|
179
|
-
logger.level = 1
|
180
|
-
p "Main is debug? #{logger.debug?}"
|
181
|
-
|
182
|
-
Fiber.new {
|
183
|
-
logger.local_level = 0
|
184
|
-
p "Thread is debug? #{logger.debug?}"
|
185
|
-
}.resume
|
186
|
-
|
187
|
-
p "Main is debug? #{logger.debug?}"
|
188
|
-
|
189
|
-
Before:
|
190
|
-
|
191
|
-
Main is debug? false
|
192
|
-
Thread is debug? true
|
193
|
-
Main is debug? true
|
194
|
-
|
195
|
-
After:
|
196
|
-
|
197
|
-
Main is debug? false
|
198
|
-
Thread is debug? true
|
199
|
-
Main is debug? false
|
200
|
-
|
201
|
-
*Alexander Varnin*
|
202
|
-
|
203
|
-
* Do not delegate missing `marshal_dump` and `_dump` methods via the
|
204
|
-
`delegate_missing_to` extension. This avoids unintentionally adding instance
|
205
|
-
variables when calling `Marshal.dump(object)`, should the delegation target of
|
206
|
-
`object` be a method which would otherwise add them. Fixes #36522.
|
207
|
-
|
208
|
-
*Aaron Lipman*
|
209
|
-
|
210
|
-
|
211
|
-
## Rails 6.0.0.rc2 (July 22, 2019) ##
|
212
|
-
|
213
|
-
* `truncate` would return the original string if it was too short to be truncated
|
214
|
-
and a frozen string if it were long enough to be truncated. Now truncate will
|
215
|
-
consistently return an unfrozen string regardless. This behavior is consistent
|
216
|
-
with `gsub` and `strip`.
|
217
|
-
|
218
|
-
Before:
|
219
|
-
|
220
|
-
'foobar'.truncate(5).frozen?
|
221
|
-
# => true
|
222
|
-
'foobar'.truncate(6).frozen?
|
223
|
-
# => false
|
224
|
-
|
225
|
-
After:
|
226
|
-
|
227
|
-
'foobar'.truncate(5).frozen?
|
228
|
-
# => false
|
229
|
-
'foobar'.truncate(6).frozen?
|
230
|
-
# => false
|
231
|
-
|
232
|
-
*Jordan Thomas*
|
233
|
-
|
234
|
-
|
235
|
-
## Rails 6.0.0.rc1 (April 24, 2019) ##
|
236
|
-
|
237
|
-
* Speed improvements to `Hash.except` and `HashWithIndifferentAccess#except`.
|
238
|
-
|
239
|
-
These methods now unset the `default`/`default_proc` on the returned Hash, compatible with Ruby 3.0’s native implementation.
|
240
|
-
|
241
118
|
*Timo Schilling*
|
242
119
|
|
243
|
-
*
|
244
|
-
|
245
|
-
Actionable errors let's you dispatch actions from Rails' error pages. This
|
246
|
-
can help you save time if you have a clear action for the resolution of
|
247
|
-
common development errors.
|
248
|
-
|
249
|
-
The de-facto example are pending migrations. Every time pending migrations
|
250
|
-
are found, a middleware raises an error. With actionable errors, you can
|
251
|
-
run the migrations right from the error page. Other examples include Rails
|
252
|
-
plugins that need to run a rake task to setup themselves. They can now
|
253
|
-
raise actionable errors to run the setup straight from the error pages.
|
254
|
-
|
255
|
-
Here is how to define an actionable error:
|
256
|
-
|
257
|
-
```ruby
|
258
|
-
class PendingMigrationError < MigrationError #:nodoc:
|
259
|
-
include ActiveSupport::ActionableError
|
260
|
-
|
261
|
-
action "Run pending migrations" do
|
262
|
-
ActiveRecord::Tasks::DatabaseTasks.migrate
|
263
|
-
end
|
264
|
-
end
|
265
|
-
```
|
266
|
-
|
267
|
-
To make an error actionable, include the `ActiveSupport::ActionableError`
|
268
|
-
module and invoke the `action` class macro to define the action. An action
|
269
|
-
needs a name and a procedure to execute. The name is shown as the name of a
|
270
|
-
button on the error pages. Once clicked, it will invoke the given
|
271
|
-
procedure.
|
272
|
-
|
273
|
-
*Vipul A M*, *Yao Jie*, *Genadi Samokovarov*
|
120
|
+
* Remove deprecate `ActiveSupport::Multibyte::Unicode.default_normalization_form`.
|
274
121
|
|
275
|
-
*
|
276
|
-
|
277
|
-
Before:
|
278
|
-
|
279
|
-
("<br />".html_safe * 2).html_safe? #=> nil
|
280
|
-
|
281
|
-
After:
|
282
|
-
|
283
|
-
("<br />".html_safe * 2).html_safe? #=> true
|
284
|
-
|
285
|
-
*Ryo Nakamura*
|
286
|
-
|
287
|
-
* Calling test methods with `with_info_handler` method to allow minitest-hooks
|
288
|
-
plugin to work.
|
289
|
-
|
290
|
-
*Mauri Mustonen*
|
291
|
-
|
292
|
-
* The Zeitwerk compatibility interface for `ActiveSupport::Dependencies` no
|
293
|
-
longer implements `autoloaded_constants` or `autoloaded?` (undocumented,
|
294
|
-
anyway). Experience shows introspection does not have many use cases, and
|
295
|
-
troubleshooting is done by logging. With this design trade-off we are able
|
296
|
-
to use even less memory in all environments.
|
297
|
-
|
298
|
-
*Xavier Noria*
|
299
|
-
|
300
|
-
* Depends on Zeitwerk 2, which stores less metadata if reloading is disabled
|
301
|
-
and hence uses less memory when `config.cache_classes` is `true`, a standard
|
302
|
-
setup in production.
|
303
|
-
|
304
|
-
*Xavier Noria*
|
305
|
-
|
306
|
-
* In `:zeitwerk` mode, eager load directories in engines and applications only
|
307
|
-
if present in their respective `config.eager_load_paths`.
|
308
|
-
|
309
|
-
A common use case for this is adding `lib` to `config.autoload_paths`, but
|
310
|
-
not to `config.eager_load_paths`. In that configuration, for example, files
|
311
|
-
in the `lib` directory should not be eager loaded.
|
312
|
-
|
313
|
-
*Xavier Noria*
|
314
|
-
|
315
|
-
* Fix bug in Range comparisons when comparing to an excluded-end Range
|
316
|
-
|
317
|
-
Before:
|
318
|
-
|
319
|
-
(1..10).cover?(1...11) # => false
|
320
|
-
|
321
|
-
After:
|
322
|
-
|
323
|
-
(1..10).cover?(1...11) # => true
|
324
|
-
|
325
|
-
With the same change for `Range#include?` and `Range#===`.
|
326
|
-
|
327
|
-
*Owen Stephens*
|
328
|
-
|
329
|
-
* Use weak references in descendants tracker to allow anonymous subclasses to
|
330
|
-
be garbage collected.
|
122
|
+
*Rafael Mendonça França*
|
331
123
|
|
332
|
-
|
124
|
+
* Remove deprecated support to use `Range#include?` to check the inclusion of a value in
|
125
|
+
a date time range is deprecated.
|
333
126
|
|
334
|
-
*
|
335
|
-
passing a block optional. This will let users use
|
336
|
-
`ActiveSupport::Notifications` messaging features outside of
|
337
|
-
instrumentation.
|
127
|
+
*Rafael Mendonça França*
|
338
128
|
|
339
|
-
|
129
|
+
* Remove deprecated `URI.parser`.
|
340
130
|
|
341
|
-
*
|
131
|
+
*Rafael Mendonça França*
|
342
132
|
|
343
|
-
|
133
|
+
* Remove deprecated `config.active_support.use_sha1_digests`.
|
344
134
|
|
345
|
-
|
135
|
+
*Rafael Mendonça França*
|
346
136
|
|
347
|
-
|
137
|
+
* Invoking `Object#with_options` without a `&block` argument returns the
|
138
|
+
`ActiveSupport::OptionMerger` instance.
|
348
139
|
|
349
|
-
|
140
|
+
*Sean Doyle*
|
350
141
|
|
351
|
-
|
142
|
+
* `Rails.application.executor` hooks can now be called around every test
|
352
143
|
|
353
|
-
|
144
|
+
This helps to better simulate request or job local state being reset around tests and prevents state
|
145
|
+
leaking from one test to another.
|
354
146
|
|
355
|
-
|
147
|
+
However it requires the executor hooks executed in the test environment to be re-entrant.
|
356
148
|
|
357
|
-
|
149
|
+
To enable this, set `config.active_support.executor_around_test_case = true` (this is the default in Rails 7).
|
358
150
|
|
359
|
-
*
|
151
|
+
*Jean Boussier*
|
360
152
|
|
361
|
-
|
153
|
+
* `ActiveSupport::DescendantsTracker` now mostly delegate to `Class#descendants` on Ruby 3.1
|
362
154
|
|
363
|
-
|
364
|
-
"Fünf autos".parameterize(locale: :de) # => "fuenf-autos"
|
365
|
-
ActiveSupport::Inflector.parameterize("Fünf autos", locale: :de) # => "fuenf-autos"
|
155
|
+
Ruby now provides a fast `Class#descendants` making `ActiveSupport::DescendantsTracker` mostly useless.
|
366
156
|
|
367
|
-
|
157
|
+
As a result the following methods are deprecated:
|
368
158
|
|
369
|
-
|
159
|
+
- `ActiveSupport::DescendantsTracker.direct_descendants`
|
160
|
+
- `ActiveSupport::DescendantsTracker#direct_descendants`
|
370
161
|
|
371
|
-
|
162
|
+
*Jean Boussier*
|
372
163
|
|
373
|
-
|
164
|
+
* Fix the `Digest::UUID.uuid_from_hash` behavior for namespace IDs that are different from the ones defined on `Digest::UUID`.
|
374
165
|
|
375
|
-
|
376
|
-
`
|
166
|
+
The new behavior will be enabled by setting the
|
167
|
+
`config.active_support.use_rfc4122_namespaced_uuids` option to `true`
|
168
|
+
and is the default for new apps.
|
377
169
|
|
378
|
-
|
170
|
+
The old behavior is the default for upgraded apps and will output a
|
171
|
+
deprecation warning every time a value that is different than one of
|
172
|
+
the constants defined on the `Digest::UUID` extension is used as the
|
173
|
+
namespace ID.
|
379
174
|
|
380
|
-
*
|
175
|
+
*Alex Robbin*, *Erich Soares Machado*, *Eugene Kenny*
|
381
176
|
|
382
|
-
|
383
|
-
|
177
|
+
* `ActiveSupport::Inflector::Inflections#clear(:acronyms)` is now supported,
|
178
|
+
and `inflector.clear` / `inflector.clear(:all)` also clears acronyms.
|
384
179
|
|
385
|
-
*
|
180
|
+
*Alex Ghiculescu*, *Oliver Peate*
|
386
181
|
|
387
182
|
|
388
|
-
## Rails
|
183
|
+
## Rails 7.0.0.alpha2 (September 15, 2021) ##
|
389
184
|
|
390
185
|
* No changes.
|
391
186
|
|
392
187
|
|
393
|
-
## Rails
|
188
|
+
## Rails 7.0.0.alpha1 (September 15, 2021) ##
|
394
189
|
|
395
|
-
*
|
190
|
+
* `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.
|
396
191
|
|
397
192
|
*Xavier Noria*
|
398
193
|
|
399
|
-
*
|
400
|
-
|
401
|
-
*Zach Kemp*
|
402
|
-
|
403
|
-
* Add `before_reset` callback to `CurrentAttributes` and define `after_reset` as an alias of `resets` for symmetry.
|
404
|
-
|
405
|
-
*Rosa Gutierrez*
|
406
|
-
|
407
|
-
* Remove the `` Kernel#` `` override that suppresses ENOENT and accidentally returns nil on Unix systems.
|
408
|
-
|
409
|
-
*Akinori Musha*
|
410
|
-
|
411
|
-
* Add `ActiveSupport::HashWithIndifferentAccess#assoc`.
|
412
|
-
|
413
|
-
`assoc` can now be called with either a string or a symbol.
|
414
|
-
|
415
|
-
*Stefan Schüßler*
|
416
|
-
|
417
|
-
* Add `Hash#deep_transform_values`, and `Hash#deep_transform_values!`.
|
418
|
-
|
419
|
-
*Guillermo Iguaran*
|
420
|
-
|
421
|
-
|
422
|
-
## Rails 6.0.0.beta1 (January 18, 2019) ##
|
423
|
-
|
424
|
-
* Remove deprecated `Module#reachable?` method.
|
425
|
-
|
426
|
-
*Rafael Mendonça França*
|
427
|
-
|
428
|
-
* Remove deprecated `#acronym_regex` method from `Inflections`.
|
429
|
-
|
430
|
-
*Rafael Mendonça França*
|
431
|
-
|
432
|
-
* Fix `String#safe_constantize` throwing a `LoadError` for incorrectly cased constant references.
|
433
|
-
|
434
|
-
*Keenan Brock*
|
194
|
+
* Private internal classes of `ActiveSupport::Dependencies` have been deleted, like `ActiveSupport::Dependencies::Reference`, `ActiveSupport::Dependencies::Blamable`, and others.
|
435
195
|
|
436
|
-
*
|
437
|
-
|
438
|
-
`fetch_multi(*names)` now returns its results in the same order as the `*names` requested, rather than returning cache hits followed by cache misses.
|
439
|
-
|
440
|
-
*Gannon McGibbon*
|
196
|
+
*Xavier Noria*
|
441
197
|
|
442
|
-
*
|
198
|
+
* The private API of `ActiveSupport::Dependencies` has been deleted. That includes methods like `hook!`, `unhook!`, `depend_on`, `require_or_load`, `mechanism`, and many others.
|
443
199
|
|
444
|
-
*
|
200
|
+
*Xavier Noria*
|
445
201
|
|
446
|
-
*
|
447
|
-
would not act as alias for `#symbolize_keys`.
|
202
|
+
* Improves the performance of `ActiveSupport::NumberHelper` formatters by avoiding the use of exceptions as flow control.
|
448
203
|
|
449
|
-
*
|
204
|
+
*Mike Dalessio*
|
450
205
|
|
451
|
-
*
|
206
|
+
* Removed rescue block from `ActiveSupport::Cache::RedisCacheStore#handle_exception`
|
452
207
|
|
453
|
-
|
208
|
+
Previously, if you provided a `error_handler` to `redis_cache_store`, any errors thrown by
|
209
|
+
the error handler would be rescued and logged only. Removed the `rescue` clause from `handle_exception`
|
210
|
+
to allow these to be thrown.
|
454
211
|
|
455
|
-
*
|
456
|
-
in favor of `array.flatten.pack("U*")` and `string.scan(/\X/).map(&:codepoints)`, respectively.
|
212
|
+
*Nicholas A. Stuart*
|
457
213
|
|
458
|
-
|
214
|
+
* Allow entirely opting out of deprecation warnings.
|
459
215
|
|
460
|
-
|
216
|
+
Previously if you did `app.config.active_support.deprecation = :silence`, some work would
|
217
|
+
still be done on each call to `ActiveSupport::Deprecation.warn`. In very hot paths, this could
|
218
|
+
cause performance issues.
|
461
219
|
|
462
|
-
|
220
|
+
Now, you can make `ActiveSupport::Deprecation.warn` a no-op:
|
463
221
|
|
464
|
-
|
465
|
-
|
466
|
-
time = DateTime.parse("2018-1-1")
|
467
|
-
time += 0.51.seconds
|
222
|
+
```ruby
|
223
|
+
config.active_support.report_deprecations = false
|
468
224
|
```
|
469
|
-
Will now correctly add 0.51 second and not 1 full second.
|
470
|
-
|
471
|
-
*Edouard Chin*
|
472
|
-
|
473
|
-
* Deprecate `ActiveSupport::Multibyte::Unicode#normalize` and `ActiveSupport::Multibyte::Chars#normalize`
|
474
|
-
in favor of `String#unicode_normalize`
|
475
|
-
|
476
|
-
*Francesco Rodríguez*
|
477
|
-
|
478
|
-
* Deprecate `ActiveSupport::Multibyte::Unicode#downcase/upcase/swapcase` in favor of
|
479
|
-
`String#downcase/upcase/swapcase`.
|
480
|
-
|
481
|
-
*Francesco Rodríguez*
|
482
225
|
|
483
|
-
|
226
|
+
This is the default in production for new apps. It is the equivalent to:
|
484
227
|
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
*Gannon McGibbon*
|
491
|
-
|
492
|
-
* Deprecate the use of `LoggerSilence` in favor of `ActiveSupport::LoggerSilence`
|
493
|
-
|
494
|
-
*Edouard Chin*
|
495
|
-
|
496
|
-
* Deprecate using negative limits in `String#first` and `String#last`.
|
497
|
-
|
498
|
-
*Gannon McGibbon*, *Eric Turner*
|
228
|
+
```ruby
|
229
|
+
config.active_support.deprecation = :silence
|
230
|
+
config.active_support.disallowed_deprecation = :silence
|
231
|
+
```
|
499
232
|
|
500
|
-
|
501
|
-
with symbol arguments
|
233
|
+
but will take a more optimised code path.
|
502
234
|
|
503
|
-
*
|
235
|
+
*Alex Ghiculescu*
|
504
236
|
|
505
|
-
*
|
506
|
-
|
237
|
+
* Faster tests by parallelizing only when overhead is justified by the number
|
238
|
+
of them.
|
507
239
|
|
508
|
-
|
240
|
+
Running tests in parallel adds overhead in terms of database
|
241
|
+
setup and fixture loading. Now, Rails will only parallelize test executions when
|
242
|
+
there are enough tests to make it worth it.
|
509
243
|
|
510
|
-
|
511
|
-
|
244
|
+
This threshold is 50 by default, and is configurable via config setting in
|
245
|
+
your test.rb:
|
512
246
|
|
513
|
-
|
247
|
+
```ruby
|
248
|
+
config.active_support.test_parallelization_threshold = 100
|
249
|
+
```
|
514
250
|
|
515
|
-
|
251
|
+
It's also configurable at the test case level:
|
516
252
|
|
517
|
-
|
253
|
+
```ruby
|
254
|
+
class ActiveSupport::TestCase
|
255
|
+
parallelize threshold: 100
|
256
|
+
end
|
257
|
+
```
|
518
258
|
|
519
|
-
*
|
259
|
+
*Jorge Manrubia*
|
520
260
|
|
521
|
-
*
|
261
|
+
* OpenSSL constants are now used for Digest computations.
|
522
262
|
|
523
|
-
|
524
|
-
ActiveSupport::Dependencies.verbose = true
|
263
|
+
*Dirkjan Bussink*
|
525
264
|
|
526
|
-
|
265
|
+
* `TimeZone.iso8601` now accepts valid ordinal values similar to Ruby's `Date._iso8601` method.
|
266
|
+
A valid ordinal value will be converted to an instance of `TimeWithZone` using the `:year`
|
267
|
+
and `:yday` fragments returned from `Date._iso8601`.
|
527
268
|
|
528
|
-
|
269
|
+
```ruby
|
270
|
+
twz = ActiveSupport::TimeZone["Eastern Time (US & Canada)"].iso8601("21087")
|
271
|
+
twz.to_a[0, 6] == [0, 0, 0, 28, 03, 2021]
|
272
|
+
```
|
529
273
|
|
530
|
-
*
|
274
|
+
*Steve Laing*
|
531
275
|
|
532
|
-
|
533
|
-
|
276
|
+
* `Time#change` and methods that call it (e.g. `Time#advance`) will now
|
277
|
+
return a `Time` with the timezone argument provided, if the caller was
|
278
|
+
initialized with a timezone argument.
|
534
279
|
|
535
|
-
|
280
|
+
Fixes [#42467](https://github.com/rails/rails/issues/42467).
|
536
281
|
|
537
|
-
*
|
282
|
+
*Alex Ghiculescu*
|
538
283
|
|
539
|
-
|
540
|
-
If no block is given, an Enumerator is returned instead.
|
284
|
+
* Allow serializing any module or class to JSON by name.
|
541
285
|
|
542
|
-
|
543
|
-
odd_numbers = numbers.extract! { |number| number.odd? } # => [1, 3, 5, 7, 9]
|
544
|
-
numbers # => [0, 2, 4, 6, 8]
|
286
|
+
*Tyler Rick*, *Zachary Scott*
|
545
287
|
|
546
|
-
|
288
|
+
* Raise `ActiveSupport::EncryptedFile::MissingKeyError` when the
|
289
|
+
`RAILS_MASTER_KEY` environment variable is blank (e.g. `""`).
|
547
290
|
|
548
|
-
*
|
291
|
+
*Sunny Ripert*
|
549
292
|
|
550
|
-
|
551
|
-
cache.exist?('bar') # => false
|
293
|
+
* The `from:` option is added to `ActiveSupport::TestCase#assert_no_changes`.
|
552
294
|
|
553
|
-
|
295
|
+
It permits asserting on the initial value that is expected not to change.
|
554
296
|
|
555
|
-
|
556
|
-
|
557
|
-
|
297
|
+
```ruby
|
298
|
+
assert_no_changes -> { Status.all_good? }, from: true do
|
299
|
+
post :create, params: { status: { ok: true } }
|
300
|
+
end
|
301
|
+
```
|
558
302
|
|
559
|
-
|
560
|
-
@event = ActiveSupport::Notifications::Event.new(*args)
|
561
|
-
end
|
303
|
+
*George Claghorn*
|
562
304
|
|
563
|
-
|
564
|
-
sleep 1
|
565
|
-
end
|
305
|
+
* Deprecate `ActiveSupport::SafeBuffer`'s incorrect implicit conversion of objects into string.
|
566
306
|
|
567
|
-
|
307
|
+
Except for a few methods like `String#%`, objects must implement `#to_str`
|
308
|
+
to be implicitly converted to a String in string operations. In some
|
309
|
+
circumstances `ActiveSupport::SafeBuffer` was incorrectly calling the
|
310
|
+
explicit conversion method (`#to_s`) on them. This behavior is now
|
311
|
+
deprecated.
|
568
312
|
|
569
|
-
|
570
|
-
parameter, the framework will yield an event object to the block. Now
|
571
|
-
end users are no longer required to make their own:
|
313
|
+
*Jean Boussier*
|
572
314
|
|
573
|
-
|
574
|
-
@event = event
|
575
|
-
end
|
315
|
+
* Allow nested access to keys on `Rails.application.credentials`.
|
576
316
|
|
577
|
-
|
578
|
-
sleep 1
|
579
|
-
end
|
317
|
+
Previously only top level keys in `credentials.yml.enc` could be accessed with method calls. Now any key can.
|
580
318
|
|
581
|
-
|
582
|
-
p @event.cpu_time # => 0.256
|
583
|
-
p @event.idle_time # => 1003.2399
|
319
|
+
For example, given these secrets:
|
584
320
|
|
585
|
-
|
321
|
+
```yml
|
322
|
+
aws:
|
323
|
+
access_key_id: 123
|
324
|
+
secret_access_key: 345
|
325
|
+
```
|
586
326
|
|
587
|
-
|
327
|
+
`Rails.application.credentials.aws.access_key_id` will now return the same thing as
|
328
|
+
`Rails.application.credentials.aws[:access_key_id]`.
|
588
329
|
|
589
|
-
*
|
330
|
+
*Alex Ghiculescu*
|
590
331
|
|
591
|
-
|
332
|
+
* Added a faster and more compact `ActiveSupport::Cache` serialization format.
|
592
333
|
|
593
|
-
|
334
|
+
It can be enabled with `config.active_support.cache_format_version = 7.0` or
|
335
|
+
`config.load_defaults 7.0`. Regardless of the configuration Active Support
|
336
|
+
7.0 can read cache entries serialized by Active Support 6.1 which allows to
|
337
|
+
upgrade without invalidating the cache. However Rails 6.1 can't read the
|
338
|
+
new format, so all readers must be upgraded before the new format is enabled.
|
594
339
|
|
595
|
-
|
340
|
+
*Jean Boussier*
|
596
341
|
|
597
|
-
|
342
|
+
* Add `Enumerable#sole`, per `ActiveRecord::FinderMethods#sole`. Returns the
|
343
|
+
sole item of the enumerable, raising if no items are found, or if more than
|
344
|
+
one is.
|
598
345
|
|
599
|
-
|
346
|
+
*Asherah Connor*
|
600
347
|
|
601
|
-
|
348
|
+
* Freeze `ActiveSupport::Duration#parts` and remove writer methods.
|
602
349
|
|
603
|
-
|
350
|
+
Durations are meant to be value objects and should not be mutated.
|
604
351
|
|
605
|
-
|
606
|
-
`Range#===`. `Range#===` works correctly on Ruby 2.6. `Range#include?` is moved
|
607
|
-
into a new file, with these two methods.
|
352
|
+
*Andrew White*
|
608
353
|
|
609
|
-
|
610
|
-
*Use `require "active_support/core_ext/range/compare_range"` instead.*
|
354
|
+
* Fix `ActiveSupport::TimeZone#utc_to_local` with fractional seconds.
|
611
355
|
|
612
|
-
|
356
|
+
When `utc_to_local_returns_utc_offset_times` is false and the time
|
357
|
+
instance had fractional seconds the new UTC time instance was out by
|
358
|
+
a factor of 1,000,000 as the `Time.utc` constructor takes a usec
|
359
|
+
value and not a fractional second value.
|
613
360
|
|
614
|
-
*
|
361
|
+
*Andrew White*
|
615
362
|
|
616
|
-
|
617
|
-
or a default argument.
|
363
|
+
* Add `expires_at` argument to `ActiveSupport::Cache` `write` and `fetch` to set a cache entry TTL as an absolute time.
|
618
364
|
|
619
|
-
|
620
|
-
|
365
|
+
```ruby
|
366
|
+
Rails.cache.write(key, value, expires_at: Time.now.at_end_of_hour)
|
367
|
+
```
|
621
368
|
|
622
|
-
|
623
|
-
# => { title: nil, body: nil }
|
369
|
+
*Jean Boussier*
|
624
370
|
|
625
|
-
|
371
|
+
* Deprecate `ActiveSupport::TimeWithZone.name` so that from Rails 7.1 it will use the default implementation.
|
626
372
|
|
627
|
-
*
|
373
|
+
*Andrew White*
|
628
374
|
|
629
|
-
*
|
630
|
-
|
375
|
+
* Deprecates Rails custom `Enumerable#sum` and `Array#sum` in favor of Ruby's native implementation which
|
376
|
+
is considerably faster.
|
631
377
|
|
632
|
-
|
378
|
+
Ruby requires an initializer for non-numeric type as per examples below:
|
633
379
|
|
634
|
-
|
635
|
-
|
380
|
+
```ruby
|
381
|
+
%w[foo bar].sum('')
|
382
|
+
# instead of %w[foo bar].sum
|
636
383
|
|
637
|
-
|
384
|
+
[[1, 2], [3, 4, 5]].sum([])
|
385
|
+
# instead of [[1, 2], [3, 4, 5]].sum
|
386
|
+
```
|
638
387
|
|
639
|
-
*
|
640
|
-
size when compression is enabled (which is true by default). This patch
|
641
|
-
does not attempt to repair existing data: please manually flush the cache
|
642
|
-
to clear out the problematic entries.
|
388
|
+
*Alberto Mota*
|
643
389
|
|
644
|
-
|
390
|
+
* Tests parallelization is now disabled when running individual files to prevent the setup overhead.
|
645
391
|
|
646
|
-
|
392
|
+
It can still be enforced if the environment variable `PARALLEL_WORKERS` is present and set to a value greater than 1.
|
647
393
|
|
648
|
-
|
649
|
-
URI.unescape("%E3%83%90") # => "バ"
|
650
|
-
URI.unescape("\xe3\x83\x90%E3%83%90") # => Encoding::CompatibilityError
|
394
|
+
*Ricardo Díaz*
|
651
395
|
|
652
|
-
|
396
|
+
* Fix proxying keyword arguments in `ActiveSupport::CurrentAttributes`.
|
653
397
|
|
654
|
-
*
|
655
|
-
`Time`, and `TimeWithZone`.
|
398
|
+
*Marcin Kołodziej*
|
656
399
|
|
657
|
-
|
400
|
+
* Add `Enumerable#maximum` and `Enumerable#minimum` to easily calculate the maximum or minimum from extracted
|
401
|
+
elements of an enumerable.
|
658
402
|
|
659
|
-
|
660
|
-
|
403
|
+
```ruby
|
404
|
+
payments = [Payment.new(5), Payment.new(15), Payment.new(10)]
|
661
405
|
|
662
|
-
|
406
|
+
payments.minimum(:price) # => 5
|
407
|
+
payments.maximum(:price) # => 15
|
408
|
+
```
|
663
409
|
|
664
|
-
|
665
|
-
|
666
|
-
number: {
|
667
|
-
nth: {
|
668
|
-
ordinals: lambda do |_key, number:, **_options|
|
669
|
-
if number.to_i.abs == 1
|
670
|
-
'er'
|
671
|
-
else
|
672
|
-
'e'
|
673
|
-
end
|
674
|
-
end,
|
410
|
+
This also allows passing enumerables to `fresh_when` and `stale?` in Action Controller.
|
411
|
+
See PR [#41404](https://github.com/rails/rails/pull/41404) for an example.
|
675
412
|
|
676
|
-
|
677
|
-
"#{number}#{ActiveSupport::Inflector.ordinal(number)}"
|
678
|
-
end
|
679
|
-
}
|
680
|
-
}
|
681
|
-
}
|
682
|
-
}
|
413
|
+
*Ayrton De Craene*
|
683
414
|
|
415
|
+
* `ActiveSupport::Cache::MemCacheStore` now accepts an explicit `nil` for its `addresses` argument.
|
684
416
|
|
685
|
-
|
417
|
+
```ruby
|
418
|
+
config.cache_store = :mem_cache_store, nil
|
686
419
|
|
687
|
-
|
688
|
-
in order to delegate methods as private:
|
420
|
+
# is now equivalent to
|
689
421
|
|
690
|
-
|
691
|
-
has_one :profile
|
692
|
-
delegate :date_of_birth, to: :profile, private: true
|
422
|
+
config.cache_store = :mem_cache_store
|
693
423
|
|
694
|
-
|
695
|
-
Date.today.year - date_of_birth.year
|
696
|
-
end
|
697
|
-
end
|
424
|
+
# and is also equivalent to
|
698
425
|
|
699
|
-
|
700
|
-
# User.new.date_of_birth
|
701
|
-
# => NoMethodError: private method `date_of_birth' called for #<User:0x00000008221340>
|
426
|
+
config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211"
|
702
427
|
|
703
|
-
|
428
|
+
# which is the fallback behavior of Dalli
|
429
|
+
```
|
704
430
|
|
705
|
-
|
706
|
-
breaking multibyte characters or grapheme clusters like 👩👩👦👦.
|
431
|
+
This helps those migrating from `:dalli_store`, where an explicit `nil` was permitted.
|
707
432
|
|
708
|
-
*
|
433
|
+
*Michael Overmeyer*
|
709
434
|
|
710
|
-
* `
|
435
|
+
* Add `Enumerable#in_order_of` to put an Enumerable in a certain order by a key.
|
711
436
|
|
712
|
-
|
437
|
+
*DHH*
|
713
438
|
|
714
|
-
|
439
|
+
* `ActiveSupport::Inflector.camelize` behaves expected when provided a symbol `:upper` or `:lower` argument. Matches
|
440
|
+
`String#camelize` behavior.
|
715
441
|
|
716
|
-
|
442
|
+
*Alex Ghiculescu*
|
717
443
|
|
718
|
-
|
719
|
-
|
720
|
-
MSG
|
444
|
+
* Raises an `ArgumentError` when the first argument of `ActiveSupport::Notification.subscribe` is
|
445
|
+
invalid.
|
721
446
|
|
722
|
-
|
447
|
+
*Vipul A M*
|
723
448
|
|
724
|
-
|
449
|
+
* `HashWithIndifferentAccess#deep_transform_keys` now returns a `HashWithIndifferentAccess` instead of a `Hash`.
|
725
450
|
|
726
|
-
*
|
451
|
+
*Nathaniel Woodthorpe*
|
727
452
|
|
728
|
-
|
453
|
+
* Consume dalli’s `cache_nils` configuration as `ActiveSupport::Cache`'s `skip_nil` when using `MemCacheStore`.
|
729
454
|
|
730
|
-
*
|
455
|
+
*Ritikesh G*
|
731
456
|
|
732
|
-
|
457
|
+
* Add `RedisCacheStore#stats` method similar to `MemCacheStore#stats`. Calls `redis#info` internally.
|
733
458
|
|
734
|
-
*
|
459
|
+
*Ritikesh G*
|
735
460
|
|
736
461
|
|
737
|
-
Please check [
|
462
|
+
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/activesupport/CHANGELOG.md) for previous changes.
|