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