activesupport 5.1.7 → 7.0.4.1
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 +259 -585
- data/MIT-LICENSE +1 -1
- data/README.rdoc +6 -5
- data/lib/active_support/actionable_error.rb +48 -0
- data/lib/active_support/all.rb +2 -0
- data/lib/active_support/array_inquirer.rb +4 -2
- data/lib/active_support/backtrace_cleaner.rb +33 -5
- data/lib/active_support/benchmarkable.rb +5 -3
- data/lib/active_support/builder.rb +2 -0
- data/lib/active_support/cache/file_store.rb +50 -43
- data/lib/active_support/cache/mem_cache_store.rb +194 -67
- data/lib/active_support/cache/memory_store.rb +70 -34
- data/lib/active_support/cache/null_store.rb +18 -3
- data/lib/active_support/cache/redis_cache_store.rb +474 -0
- data/lib/active_support/cache/strategy/local_cache.rb +73 -50
- data/lib/active_support/cache/strategy/local_cache_middleware.rb +2 -0
- data/lib/active_support/cache.rb +556 -220
- data/lib/active_support/callbacks.rb +264 -159
- data/lib/active_support/code_generator.rb +65 -0
- data/lib/active_support/concern.rb +81 -8
- data/lib/active_support/concurrency/load_interlock_aware_monitor.rb +16 -0
- data/lib/active_support/concurrency/share_lock.rb +4 -3
- data/lib/active_support/configurable.rb +17 -16
- data/lib/active_support/configuration_file.rb +51 -0
- data/lib/active_support/core_ext/array/access.rb +18 -8
- data/lib/active_support/core_ext/array/conversions.rb +20 -17
- data/lib/active_support/core_ext/array/deprecated_conversions.rb +25 -0
- data/lib/active_support/core_ext/array/extract.rb +21 -0
- data/lib/active_support/core_ext/array/extract_options.rb +2 -0
- data/lib/active_support/core_ext/array/grouping.rb +8 -6
- data/lib/active_support/core_ext/array/inquiry.rb +4 -2
- data/lib/active_support/core_ext/array/wrap.rb +2 -0
- data/lib/active_support/core_ext/array.rb +4 -1
- data/lib/active_support/core_ext/benchmark.rb +4 -2
- data/lib/active_support/core_ext/big_decimal/conversions.rb +3 -1
- data/lib/active_support/core_ext/big_decimal.rb +2 -0
- data/lib/active_support/core_ext/class/attribute.rb +50 -47
- data/lib/active_support/core_ext/class/attribute_accessors.rb +2 -0
- data/lib/active_support/core_ext/class/subclasses.rb +10 -24
- data/lib/active_support/core_ext/class.rb +2 -0
- data/lib/active_support/core_ext/date/acts_like.rb +2 -0
- data/lib/active_support/core_ext/date/blank.rb +3 -1
- data/lib/active_support/core_ext/date/calculations.rb +17 -14
- data/lib/active_support/core_ext/date/conversions.rb +24 -22
- data/lib/active_support/core_ext/date/deprecated_conversions.rb +26 -0
- data/lib/active_support/core_ext/date/zones.rb +2 -0
- data/lib/active_support/core_ext/date.rb +3 -0
- data/lib/active_support/core_ext/date_and_time/calculations.rb +65 -41
- data/lib/active_support/core_ext/date_and_time/compatibility.rb +18 -1
- data/lib/active_support/core_ext/date_and_time/zones.rb +2 -1
- data/lib/active_support/core_ext/date_time/acts_like.rb +2 -0
- data/lib/active_support/core_ext/date_time/blank.rb +3 -1
- data/lib/active_support/core_ext/date_time/calculations.rb +3 -1
- data/lib/active_support/core_ext/date_time/compatibility.rb +7 -5
- data/lib/active_support/core_ext/date_time/conversions.rb +15 -14
- data/lib/active_support/core_ext/date_time/deprecated_conversions.rb +22 -0
- data/lib/active_support/core_ext/date_time.rb +3 -0
- data/lib/active_support/core_ext/digest/uuid.rb +42 -14
- data/lib/active_support/core_ext/digest.rb +3 -0
- data/lib/active_support/core_ext/enumerable.rb +244 -72
- data/lib/active_support/core_ext/file/atomic.rb +6 -2
- data/lib/active_support/core_ext/file.rb +2 -0
- data/lib/active_support/core_ext/hash/conversions.rb +7 -6
- data/lib/active_support/core_ext/hash/deep_merge.rb +8 -12
- data/lib/active_support/core_ext/hash/deep_transform_values.rb +46 -0
- data/lib/active_support/core_ext/hash/except.rb +4 -2
- data/lib/active_support/core_ext/hash/indifferent_access.rb +5 -3
- data/lib/active_support/core_ext/hash/keys.rb +4 -31
- data/lib/active_support/core_ext/hash/reverse_merge.rb +5 -2
- data/lib/active_support/core_ext/hash/slice.rb +8 -29
- data/lib/active_support/core_ext/hash.rb +3 -2
- data/lib/active_support/core_ext/integer/inflections.rb +2 -0
- data/lib/active_support/core_ext/integer/multiple.rb +3 -1
- data/lib/active_support/core_ext/integer/time.rb +7 -14
- data/lib/active_support/core_ext/integer.rb +2 -0
- data/lib/active_support/core_ext/kernel/concern.rb +2 -0
- data/lib/active_support/core_ext/kernel/reporting.rb +6 -4
- data/lib/active_support/core_ext/kernel/singleton_class.rb +3 -1
- data/lib/active_support/core_ext/kernel.rb +2 -1
- data/lib/active_support/core_ext/load_error.rb +3 -8
- data/lib/active_support/core_ext/module/aliasing.rb +2 -0
- data/lib/active_support/core_ext/module/anonymous.rb +2 -0
- data/lib/active_support/core_ext/module/attr_internal.rb +4 -2
- data/lib/active_support/core_ext/module/attribute_accessors.rb +46 -56
- data/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb +36 -27
- data/lib/active_support/core_ext/module/concerning.rb +15 -10
- data/lib/active_support/core_ext/module/delegation.rb +97 -58
- data/lib/active_support/core_ext/module/deprecation.rb +2 -0
- data/lib/active_support/core_ext/module/introspection.rb +18 -15
- data/lib/active_support/core_ext/module/redefine_method.rb +40 -0
- data/lib/active_support/core_ext/module/remove_method.rb +5 -23
- data/lib/active_support/core_ext/module.rb +3 -1
- data/lib/active_support/core_ext/name_error.rb +30 -2
- data/lib/active_support/core_ext/numeric/bytes.rb +2 -0
- data/lib/active_support/core_ext/numeric/conversions.rb +134 -129
- data/lib/active_support/core_ext/numeric/deprecated_conversions.rb +60 -0
- data/lib/active_support/core_ext/numeric/time.rb +7 -15
- data/lib/active_support/core_ext/numeric.rb +3 -1
- data/lib/active_support/core_ext/object/acts_like.rb +41 -6
- data/lib/active_support/core_ext/object/blank.rb +15 -5
- data/lib/active_support/core_ext/object/conversions.rb +2 -0
- data/lib/active_support/core_ext/object/deep_dup.rb +3 -1
- data/lib/active_support/core_ext/object/duplicable.rb +16 -110
- data/lib/active_support/core_ext/object/inclusion.rb +2 -0
- data/lib/active_support/core_ext/object/instance_variables.rb +2 -0
- data/lib/active_support/core_ext/object/json.rb +51 -26
- data/lib/active_support/core_ext/object/to_param.rb +2 -0
- data/lib/active_support/core_ext/object/to_query.rb +4 -2
- data/lib/active_support/core_ext/object/try.rb +26 -14
- data/lib/active_support/core_ext/object/with_options.rb +24 -3
- data/lib/active_support/core_ext/object.rb +2 -0
- 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 +57 -0
- data/lib/active_support/core_ext/range/conversions.rb +35 -25
- data/lib/active_support/core_ext/range/deprecated_conversions.rb +26 -0
- data/lib/active_support/core_ext/range/each.rb +6 -3
- data/lib/active_support/core_ext/range/include_time_with_zone.rb +7 -0
- data/lib/active_support/core_ext/range/overlaps.rb +3 -1
- data/lib/active_support/core_ext/range.rb +4 -1
- data/lib/active_support/core_ext/regexp.rb +10 -5
- data/lib/active_support/core_ext/securerandom.rb +25 -3
- data/lib/active_support/core_ext/string/access.rb +7 -16
- data/lib/active_support/core_ext/string/behavior.rb +2 -0
- data/lib/active_support/core_ext/string/conversions.rb +5 -2
- data/lib/active_support/core_ext/string/exclude.rb +2 -0
- data/lib/active_support/core_ext/string/filters.rb +44 -1
- data/lib/active_support/core_ext/string/indent.rb +2 -0
- data/lib/active_support/core_ext/string/inflections.rb +69 -16
- data/lib/active_support/core_ext/string/inquiry.rb +4 -1
- data/lib/active_support/core_ext/string/multibyte.rb +9 -4
- data/lib/active_support/core_ext/string/output_safety.rb +135 -27
- data/lib/active_support/core_ext/string/starts_ends_with.rb +4 -2
- data/lib/active_support/core_ext/string/strip.rb +5 -1
- data/lib/active_support/core_ext/string/zones.rb +2 -0
- data/lib/active_support/core_ext/string.rb +2 -0
- 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/acts_like.rb +2 -0
- data/lib/active_support/core_ext/time/calculations.rb +81 -24
- data/lib/active_support/core_ext/time/compatibility.rb +4 -2
- data/lib/active_support/core_ext/time/conversions.rb +17 -12
- data/lib/active_support/core_ext/time/deprecated_conversions.rb +22 -0
- data/lib/active_support/core_ext/time/zones.rb +12 -25
- data/lib/active_support/core_ext/time.rb +3 -0
- data/lib/active_support/core_ext/uri.rb +4 -23
- data/lib/active_support/core_ext.rb +4 -1
- data/lib/active_support/current_attributes/test_helper.rb +13 -0
- data/lib/active_support/current_attributes.rb +226 -0
- data/lib/active_support/dependencies/autoload.rb +2 -0
- data/lib/active_support/dependencies/interlock.rb +12 -18
- data/lib/active_support/dependencies/require_dependency.rb +28 -0
- data/lib/active_support/dependencies.rb +59 -715
- data/lib/active_support/deprecation/behaviors.rb +48 -13
- data/lib/active_support/deprecation/constant_accessor.rb +4 -2
- data/lib/active_support/deprecation/disallowed.rb +56 -0
- data/lib/active_support/deprecation/instance_delegator.rb +2 -1
- data/lib/active_support/deprecation/method_wrappers.rb +29 -21
- data/lib/active_support/deprecation/proxy_wrappers.rb +34 -8
- data/lib/active_support/deprecation/reporting.rb +54 -9
- data/lib/active_support/deprecation.rb +10 -3
- data/lib/active_support/descendants_tracker.rb +192 -34
- data/lib/active_support/digest.rb +22 -0
- data/lib/active_support/duration/iso8601_parser.rb +9 -9
- data/lib/active_support/duration/iso8601_serializer.rb +29 -15
- data/lib/active_support/duration.rb +158 -72
- data/lib/active_support/encrypted_configuration.rb +56 -0
- data/lib/active_support/encrypted_file.rb +129 -0
- 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 +87 -122
- 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 +46 -21
- data/lib/active_support/executor/test_helper.rb +7 -0
- data/lib/active_support/executor.rb +2 -0
- data/lib/active_support/file_update_checker.rb +2 -1
- data/lib/active_support/fork_tracker.rb +71 -0
- data/lib/active_support/gem_version.rb +7 -5
- data/lib/active_support/gzip.rb +2 -0
- data/lib/active_support/hash_with_indifferent_access.rb +126 -42
- data/lib/active_support/html_safe_translation.rb +43 -0
- data/lib/active_support/i18n.rb +5 -1
- data/lib/active_support/i18n_railtie.rb +19 -14
- data/lib/active_support/inflections.rb +2 -0
- data/lib/active_support/inflector/inflections.rb +41 -14
- data/lib/active_support/inflector/methods.rb +73 -87
- data/lib/active_support/inflector/transliterate.rb +56 -18
- data/lib/active_support/inflector.rb +2 -0
- data/lib/active_support/isolated_execution_state.rb +72 -0
- data/lib/active_support/json/decoding.rb +27 -26
- data/lib/active_support/json/encoding.rb +16 -6
- data/lib/active_support/json.rb +2 -0
- data/lib/active_support/key_generator.rb +25 -38
- data/lib/active_support/lazy_load_hooks.rb +35 -6
- data/lib/active_support/locale/en.rb +33 -0
- data/lib/active_support/locale/en.yml +8 -4
- data/lib/active_support/log_subscriber/test_helper.rb +4 -2
- data/lib/active_support/log_subscriber.rb +54 -13
- data/lib/active_support/logger.rb +4 -17
- data/lib/active_support/logger_silence.rb +13 -20
- data/lib/active_support/logger_thread_safe_level.rb +48 -10
- data/lib/active_support/message_encryptor.rb +111 -37
- data/lib/active_support/message_verifier.rb +124 -21
- data/lib/active_support/messages/metadata.rb +80 -0
- data/lib/active_support/messages/rotation_configuration.rb +23 -0
- data/lib/active_support/messages/rotator.rb +57 -0
- data/lib/active_support/multibyte/chars.rb +19 -76
- data/lib/active_support/multibyte/unicode.rb +9 -331
- data/lib/active_support/multibyte.rb +3 -1
- data/lib/active_support/notifications/fanout.rb +165 -37
- data/lib/active_support/notifications/instrumenter.rb +92 -11
- data/lib/active_support/notifications.rb +96 -30
- data/lib/active_support/number_helper/number_converter.rb +8 -9
- data/lib/active_support/number_helper/number_to_currency_converter.rb +14 -12
- data/lib/active_support/number_helper/number_to_delimited_converter.rb +6 -3
- data/lib/active_support/number_helper/number_to_human_converter.rb +6 -3
- data/lib/active_support/number_helper/number_to_human_size_converter.rb +7 -4
- data/lib/active_support/number_helper/number_to_percentage_converter.rb +5 -1
- data/lib/active_support/number_helper/number_to_phone_converter.rb +6 -3
- data/lib/active_support/number_helper/number_to_rounded_converter.rb +14 -27
- data/lib/active_support/number_helper/rounding_helper.rb +16 -34
- data/lib/active_support/number_helper.rb +38 -12
- data/lib/active_support/option_merger.rb +19 -6
- data/lib/active_support/ordered_hash.rb +4 -2
- data/lib/active_support/ordered_options.rb +18 -6
- data/lib/active_support/parameter_filter.rb +138 -0
- data/lib/active_support/per_thread_registry.rb +8 -1
- data/lib/active_support/proxy_object.rb +2 -0
- data/lib/active_support/rails.rb +3 -10
- data/lib/active_support/railtie.rb +112 -11
- data/lib/active_support/reloader.rb +12 -11
- data/lib/active_support/rescuable.rb +19 -18
- 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 +26 -15
- data/lib/active_support/string_inquirer.rb +4 -3
- data/lib/active_support/subscriber.rb +81 -42
- data/lib/active_support/tagged_logging.rb +45 -9
- data/lib/active_support/test_case.rb +86 -2
- data/lib/active_support/testing/assertions.rb +89 -21
- data/lib/active_support/testing/autorun.rb +2 -0
- data/lib/active_support/testing/constant_lookup.rb +2 -0
- data/lib/active_support/testing/declarative.rb +2 -0
- data/lib/active_support/testing/deprecation.rb +54 -2
- data/lib/active_support/testing/file_fixtures.rb +4 -0
- data/lib/active_support/testing/isolation.rb +6 -4
- data/lib/active_support/testing/method_call_assertions.rb +34 -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 +55 -0
- data/lib/active_support/testing/parallelize_executor.rb +76 -0
- data/lib/active_support/testing/setup_and_teardown.rb +12 -7
- data/lib/active_support/testing/stream.rb +6 -7
- data/lib/active_support/testing/tagged_logging.rb +3 -1
- data/lib/active_support/testing/time_helpers.rb +91 -15
- data/lib/active_support/time.rb +2 -0
- data/lib/active_support/time_with_zone.rb +168 -56
- data/lib/active_support/values/time_zone.rb +85 -37
- data/lib/active_support/version.rb +3 -1
- data/lib/active_support/xml_mini/jdom.rb +6 -5
- data/lib/active_support/xml_mini/libxml.rb +9 -7
- data/lib/active_support/xml_mini/libxmlsax.rb +7 -5
- data/lib/active_support/xml_mini/nokogiri.rb +8 -6
- data/lib/active_support/xml_mini/nokogirisax.rb +6 -4
- data/lib/active_support/xml_mini/rexml.rb +13 -4
- data/lib/active_support/xml_mini.rb +10 -15
- data/lib/active_support.rb +30 -9
- metadata +76 -35
- data/lib/active_support/core_ext/array/prepend_and_append.rb +0 -7
- data/lib/active_support/core_ext/hash/compact.rb +0 -27
- data/lib/active_support/core_ext/hash/transform_values.rb +0 -30
- data/lib/active_support/core_ext/kernel/agnostics.rb +0 -11
- data/lib/active_support/core_ext/marshal.rb +0 -22
- data/lib/active_support/core_ext/module/reachable.rb +0 -8
- data/lib/active_support/core_ext/numeric/inquiry.rb +0 -26
- data/lib/active_support/core_ext/range/include_range.rb +0 -23
- data/lib/active_support/values/unicode_tables.dat +0 -0
data/CHANGELOG.md
CHANGED
@@ -1,788 +1,462 @@
|
|
1
|
-
## Rails
|
1
|
+
## Rails 7.0.4.1 (January 17, 2023) ##
|
2
2
|
|
3
|
-
*
|
4
|
-
|
5
|
-
|
6
|
-
## Rails 5.1.6.2 (March 11, 2019) ##
|
7
|
-
|
8
|
-
* No changes.
|
3
|
+
* Avoid regex backtracking in Inflector.underscore
|
9
4
|
|
5
|
+
[CVE-2023-22796]
|
10
6
|
|
11
|
-
## Rails 5.1.6.1 (November 27, 2018) ##
|
12
|
-
|
13
|
-
* No changes.
|
14
7
|
|
8
|
+
## Rails 7.0.4 (September 09, 2022) ##
|
15
9
|
|
16
|
-
|
10
|
+
* Redis cache store is now compatible with redis-rb 5.0.
|
17
11
|
|
18
|
-
*
|
12
|
+
*Jean Boussier*
|
19
13
|
|
20
|
-
|
21
|
-
`ActiveSupport::TimeZone::MAPPING` so return all of them instead
|
22
|
-
of the first one found by using `Hash#value`. e.g:
|
14
|
+
* Fix `NoMethodError` on custom `ActiveSupport::Deprecation` behavior.
|
23
15
|
|
24
|
-
|
25
|
-
|
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.
|
26
19
|
|
27
|
-
|
28
|
-
ActiveSupport::TimeZone.country_zones("GB") # => ["Edinburgh", "London"]
|
20
|
+
This change removes this `arity` restriction of custom behaviors.
|
29
21
|
|
30
|
-
|
22
|
+
*Ryo Nakamura*
|
31
23
|
|
32
|
-
*Andrew White*
|
33
24
|
|
34
|
-
|
35
|
-
## Rails 5.1.5 (February 14, 2018) ##
|
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
|
46
|
-
|
47
|
-
* No changes.
|
48
|
-
|
49
|
-
|
50
|
-
## Rails 5.1.3 (August 03, 2017) ##
|
51
|
-
|
52
|
-
* No changes.
|
53
|
-
|
54
|
-
|
55
|
-
## Rails 5.1.3.rc3 (July 31, 2017) ##
|
56
|
-
|
57
|
-
* Fix modulo operations involving durations
|
58
|
-
|
59
|
-
Rails 5.1 introduce an `ActiveSupport::Duration::Scalar` class as a wrapper
|
60
|
-
around a numeric value as a way of ensuring a duration was the outcome of
|
61
|
-
an expression. However the implementation was missing support for modulo
|
62
|
-
operations. This support has now been added and should result in a duration
|
63
|
-
being returned from expressions involving modulo operations.
|
35
|
+
## Rails 7.0.2.4 (April 26, 2022) ##
|
64
36
|
|
65
|
-
|
37
|
+
* Fix and add protections for XSS in `ActionView::Helpers` and `ERB::Util`.
|
66
38
|
|
67
|
-
|
68
|
-
|
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.
|
69
41
|
|
70
|
-
|
42
|
+
*Álvaro Martín Fraguas*
|
71
43
|
|
72
|
-
|
73
|
-
=> 1 minute
|
74
|
-
|
75
|
-
Fixes #29603 and #29743.
|
76
|
-
|
77
|
-
*Sayan Chakraborty*, *Andrew White*
|
78
|
-
|
79
|
-
* Fix division where a duration is the denominator
|
80
|
-
|
81
|
-
PR #29163 introduced a change in behavior when a duration was the denominator
|
82
|
-
in a calculation - this was incorrect as dividing by a duration should always
|
83
|
-
return a `Numeric`. The behavior of previous versions of Rails has been restored.
|
84
|
-
|
85
|
-
Fixes #29592.
|
86
|
-
|
87
|
-
*Andrew White*
|
88
|
-
|
89
|
-
|
90
|
-
## Rails 5.1.3.rc2 (July 25, 2017) ##
|
44
|
+
## Rails 7.0.2.3 (March 08, 2022) ##
|
91
45
|
|
92
46
|
* No changes.
|
93
47
|
|
94
48
|
|
95
|
-
## Rails
|
96
|
-
|
97
|
-
* No changes.
|
98
|
-
|
99
|
-
|
100
|
-
## Rails 5.1.2 (June 26, 2017) ##
|
101
|
-
|
102
|
-
* Cache: Restore the `options = nil` argument for `LocalStore#clear`
|
103
|
-
that was removed in 5.1.0. Restores compatibility with backends that
|
104
|
-
take an options argument and use the local cache strategy.
|
105
|
-
|
106
|
-
*Jeremy Daer*
|
107
|
-
|
108
|
-
* Fix implicit coercion calculations with scalars and durations
|
109
|
-
|
110
|
-
Previously calculations where the scalar is first would be converted to a duration
|
111
|
-
of seconds but this causes issues with dates being converted to times, e.g:
|
112
|
-
|
113
|
-
Time.zone = "Beijing" # => Asia/Shanghai
|
114
|
-
date = Date.civil(2017, 5, 20) # => Mon, 20 May 2017
|
115
|
-
2 * 1.day # => 172800 seconds
|
116
|
-
date + 2 * 1.day # => Mon, 22 May 2017 00:00:00 CST +08:00
|
49
|
+
## Rails 7.0.2.2 (February 11, 2022) ##
|
117
50
|
|
118
|
-
|
119
|
-
the part structure of the duration where possible, e.g:
|
51
|
+
* Fix Reloader method signature to work with the new Executor signature
|
120
52
|
|
121
|
-
Time.zone = "Beijing" # => Asia/Shanghai
|
122
|
-
date = Date.civil(2017, 5, 20) # => Mon, 20 May 2017
|
123
|
-
2 * 1.day # => 2 days
|
124
|
-
date + 2 * 1.day # => Mon, 22 May 2017
|
125
53
|
|
126
|
-
|
127
|
-
|
128
|
-
*Andrew White*
|
129
|
-
|
130
|
-
|
131
|
-
## Rails 5.1.1 (May 12, 2017) ##
|
54
|
+
## Rails 7.0.2.1 (February 11, 2022) ##
|
132
55
|
|
133
56
|
* No changes.
|
134
57
|
|
135
58
|
|
136
|
-
## Rails
|
137
|
-
|
138
|
-
* `ActiveSupport::EventedFileUpdateChecker` no longer listens to
|
139
|
-
directories outside of the application directory.
|
59
|
+
## Rails 7.0.2 (February 08, 2022) ##
|
140
60
|
|
141
|
-
|
61
|
+
* Fix `ActiveSupport::EncryptedConfiguration` to be compatible with Psych 4
|
142
62
|
|
143
|
-
*
|
63
|
+
*Stephen Sugden*
|
144
64
|
|
145
|
-
|
146
|
-
`ActiveSupport::Timezone` instance using the supplied timezone id.
|
65
|
+
* Improve `File.atomic_write` error handling.
|
147
66
|
|
148
|
-
|
67
|
+
*Daniel Pepper*
|
149
68
|
|
150
|
-
*Andrew White*
|
151
|
-
|
152
|
-
* Add ActiveSupport::Deprecation::DeprecatedConstantAccessor
|
153
|
-
|
154
|
-
Provides transparent deprecation of constants, compatible with exceptions.
|
155
|
-
Example usage:
|
156
69
|
|
157
|
-
|
158
|
-
include ActiveSupport::Deprecation::DeprecatedConstantAccessor
|
159
|
-
deprecate_constant 'OldException', 'Elsewhere::NewException'
|
160
|
-
end
|
70
|
+
## Rails 7.0.1 (January 06, 2022) ##
|
161
71
|
|
162
|
-
|
72
|
+
* Fix `Class#descendants` and `DescendantsTracker#descendants` compatibility with Ruby 3.1.
|
163
73
|
|
164
|
-
|
165
|
-
|
166
|
-
Properly pass through the frozen `Time` or `ActiveSupport::TimeWithZone` object
|
167
|
-
when calling `#to_time`.
|
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.
|
168
76
|
|
169
|
-
*
|
77
|
+
*Jean Boussier*
|
170
78
|
|
171
|
-
* Remove implicit coercion deprecation of durations
|
172
79
|
|
173
|
-
|
174
|
-
represented the number of seconds in the duration because of unwanted side
|
175
|
-
effects with calculations on durations and dates. This unfortunately had
|
176
|
-
the side effect of forcing a explicit cast when configuring third-party
|
177
|
-
libraries like expiration in Redis, e.g:
|
80
|
+
## Rails 7.0.0 (December 15, 2021) ##
|
178
81
|
|
179
|
-
|
82
|
+
* Fix `ActiveSupport::Duration.build` to support negative values.
|
180
83
|
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
*Andrew White*
|
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`).
|
186
88
|
|
187
|
-
*
|
89
|
+
*Caleb Buxton*, *Braden Staudacher*
|
188
90
|
|
189
|
-
In 4b685aa the regex in `titleize` was updated to not match apostrophes to
|
190
|
-
better reflect the nature of the transformation. Unfortunately, this had the
|
191
|
-
side effect of breaking capitalization on the first word of a sub-string, e.g:
|
192
|
-
|
193
|
-
>> "This was 'fake news'".titleize
|
194
|
-
=> "This Was 'fake News'"
|
195
|
-
|
196
|
-
This is fixed by extending the look-behind to also check for a word
|
197
|
-
character on the other side of the apostrophe.
|
198
|
-
|
199
|
-
Fixes #28312.
|
200
|
-
|
201
|
-
*Andrew White*
|
202
|
-
|
203
|
-
* Add `rfc3339` aliases to `xmlschema` for `Time` and `ActiveSupport::TimeWithZone`
|
204
|
-
|
205
|
-
For naming consistency when using the RFC 3339 profile of ISO 8601 in applications.
|
206
|
-
|
207
|
-
*Andrew White*
|
208
91
|
|
209
|
-
|
92
|
+
## Rails 7.0.0.rc3 (December 14, 2021) ##
|
210
93
|
|
211
|
-
|
212
|
-
without a offset in contravention of the RFC 3339 standard. This method
|
213
|
-
enforces that constraint and raises an `ArgumentError` if it doesn't.
|
214
|
-
|
215
|
-
*Andrew White*
|
216
|
-
|
217
|
-
* Add `ActiveSupport::TimeZone.rfc3339` parsing method
|
218
|
-
|
219
|
-
Previously, there was no way to get a RFC 3339 timestamp into a specific
|
220
|
-
timezone without either using `parse` or chaining methods. The new method
|
221
|
-
allows parsing directly into the timezone, e.g:
|
222
|
-
|
223
|
-
>> Time.zone = "Hawaii"
|
224
|
-
=> "Hawaii"
|
225
|
-
>> Time.zone.rfc3339("1999-12-31T14:00:00Z")
|
226
|
-
=> Fri, 31 Dec 1999 14:00:00 HST -10:00
|
227
|
-
|
228
|
-
This new method has stricter semantics than the current `parse` method,
|
229
|
-
and will raise an `ArgumentError` instead of returning nil, e.g:
|
230
|
-
|
231
|
-
>> Time.zone = "Hawaii"
|
232
|
-
=> "Hawaii"
|
233
|
-
>> Time.zone.rfc3339("foobar")
|
234
|
-
ArgumentError: invalid date
|
235
|
-
>> Time.zone.parse("foobar")
|
236
|
-
=> nil
|
237
|
-
|
238
|
-
It will also raise an `ArgumentError` when either the time or offset
|
239
|
-
components are missing, e.g:
|
240
|
-
|
241
|
-
>> Time.zone = "Hawaii"
|
242
|
-
=> "Hawaii"
|
243
|
-
>> Time.zone.rfc3339("1999-12-31")
|
244
|
-
ArgumentError: invalid date
|
245
|
-
>> Time.zone.rfc3339("1999-12-31T14:00:00")
|
246
|
-
ArgumentError: invalid date
|
247
|
-
|
248
|
-
*Andrew White*
|
249
|
-
|
250
|
-
* Add `ActiveSupport::TimeZone.iso8601` parsing method
|
251
|
-
|
252
|
-
Previously, there was no way to get a ISO 8601 timestamp into a specific
|
253
|
-
timezone without either using `parse` or chaining methods. The new method
|
254
|
-
allows parsing directly into the timezone, e.g:
|
255
|
-
|
256
|
-
>> Time.zone = "Hawaii"
|
257
|
-
=> "Hawaii"
|
258
|
-
>> Time.zone.iso8601("1999-12-31T14:00:00Z")
|
259
|
-
=> Fri, 31 Dec 1999 14:00:00 HST -10:00
|
260
|
-
|
261
|
-
If the timestamp is a ISO 8601 date (YYYY-MM-DD), then the time is set
|
262
|
-
to midnight, e.g:
|
263
|
-
|
264
|
-
>> Time.zone = "Hawaii"
|
265
|
-
=> "Hawaii"
|
266
|
-
>> Time.zone.iso8601("1999-12-31")
|
267
|
-
=> Fri, 31 Dec 1999 00:00:00 HST -10:00
|
94
|
+
* No changes.
|
268
95
|
|
269
|
-
This new method has stricter semantics than the current `parse` method,
|
270
|
-
and will raise an `ArgumentError` instead of returning nil, e.g:
|
271
96
|
|
272
|
-
|
273
|
-
=> "Hawaii"
|
274
|
-
>> Time.zone.iso8601("foobar")
|
275
|
-
ArgumentError: invalid date
|
276
|
-
>> Time.zone.parse("foobar")
|
277
|
-
=> nil
|
97
|
+
## Rails 7.0.0.rc2 (December 14, 2021) ##
|
278
98
|
|
279
|
-
|
99
|
+
* No changes.
|
280
100
|
|
281
|
-
|
101
|
+
## Rails 7.0.0.rc1 (December 06, 2021) ##
|
282
102
|
|
283
|
-
|
284
|
-
|
285
|
-
addition and subtraction where the duration is the receiver, e.g:
|
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`.
|
286
105
|
|
287
|
-
|
288
|
-
=> 172800
|
106
|
+
*Rafael Mendonça França*
|
289
107
|
|
290
|
-
|
291
|
-
with dates because adding/subtracting a value from a date treats
|
292
|
-
integers as a day and not a second, e.g:
|
108
|
+
* Document `ActiveSupport::Testing::Deprecation`.
|
293
109
|
|
294
|
-
|
295
|
-
=> Wed, 01 Mar 2017
|
296
|
-
>> Date.today + 2 * 1.day
|
297
|
-
=> Mon, 10 Apr 2490
|
110
|
+
*Sam Bostock & Sam Jordan*
|
298
111
|
|
299
|
-
|
300
|
-
deprecation warning with the intent of removing the implicit coercion
|
301
|
-
in Rails 5.2, e.g:
|
112
|
+
* Add `Pathname#existence`.
|
302
113
|
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
=> 172800
|
114
|
+
```ruby
|
115
|
+
Pathname.new("file").existence&.read
|
116
|
+
```
|
307
117
|
|
308
|
-
|
118
|
+
*Timo Schilling*
|
309
119
|
|
310
|
-
|
311
|
-
TypeError: ActiveSupport::Duration can't be coerced into Integer
|
120
|
+
* Remove deprecate `ActiveSupport::Multibyte::Unicode.default_normalization_form`.
|
312
121
|
|
313
|
-
|
122
|
+
*Rafael Mendonça França*
|
314
123
|
|
315
|
-
|
316
|
-
|
317
|
-
>> "foo" * 2
|
318
|
-
=> "foofoo"
|
124
|
+
* Remove deprecated support to use `Range#include?` to check the inclusion of a value in
|
125
|
+
a date time range is deprecated.
|
319
126
|
|
320
|
-
|
321
|
-
so that calculations that keep the duration as the receiver work
|
322
|
-
correctly whether the final receiver is a `Date` or `Time`, e.g:
|
127
|
+
*Rafael Mendonça França*
|
323
128
|
|
324
|
-
|
325
|
-
=> Wed, 01 Mar 2017
|
326
|
-
>> Date.today + 1.day * 2
|
327
|
-
=> Fri, 03 Mar 2017
|
129
|
+
* Remove deprecated `URI.parser`.
|
328
130
|
|
329
|
-
|
131
|
+
*Rafael Mendonça França*
|
330
132
|
|
331
|
-
|
133
|
+
* Remove deprecated `config.active_support.use_sha1_digests`.
|
332
134
|
|
333
|
-
*
|
135
|
+
*Rafael Mendonça França*
|
334
136
|
|
335
|
-
|
336
|
-
|
137
|
+
* Invoking `Object#with_options` without a `&block` argument returns the
|
138
|
+
`ActiveSupport::OptionMerger` instance.
|
337
139
|
|
338
|
-
|
339
|
-
datetime.nsec == 999999999 # => true
|
140
|
+
*Sean Doyle*
|
340
141
|
|
341
|
-
|
142
|
+
* `Rails.application.executor` hooks can now be called around every test
|
342
143
|
|
343
|
-
|
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.
|
344
146
|
|
345
|
-
|
147
|
+
However it requires the executor hooks executed in the test environment to be re-entrant.
|
346
148
|
|
347
|
-
|
149
|
+
To enable this, set `config.active_support.executor_around_test_case = true` (this is the default in Rails 7).
|
348
150
|
|
349
|
-
|
151
|
+
*Jean Boussier*
|
350
152
|
|
351
|
-
|
352
|
-
5.days.until(today)
|
153
|
+
* `ActiveSupport::DescendantsTracker` now mostly delegate to `Class#descendants` on Ruby 3.1
|
353
154
|
|
354
|
-
|
155
|
+
Ruby now provides a fast `Class#descendants` making `ActiveSupport::DescendantsTracker` mostly useless.
|
355
156
|
|
356
|
-
|
357
|
-
5.days.before(today)
|
157
|
+
As a result the following methods are deprecated:
|
358
158
|
|
359
|
-
|
159
|
+
- `ActiveSupport::DescendantsTracker.direct_descendants`
|
160
|
+
- `ActiveSupport::DescendantsTracker#direct_descendants`
|
360
161
|
|
361
|
-
*
|
362
|
-
`ActiveSupport::HashWithIndifferentAccess` should be used instead.
|
162
|
+
*Jean Boussier*
|
363
163
|
|
364
|
-
|
164
|
+
* Fix the `Digest::UUID.uuid_from_hash` behavior for namespace IDs that are different from the ones defined on `Digest::UUID`.
|
365
165
|
|
366
|
-
|
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.
|
367
169
|
|
368
|
-
|
369
|
-
|
370
|
-
|
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.
|
371
174
|
|
372
|
-
*
|
175
|
+
*Alex Robbin*, *Erich Soares Machado*, *Eugene Kenny*
|
373
176
|
|
374
|
-
* `ActiveSupport::
|
177
|
+
* `ActiveSupport::Inflector::Inflections#clear(:acronyms)` is now supported,
|
178
|
+
and `inflector.clear` / `inflector.clear(:all)` also clears acronyms.
|
375
179
|
|
376
|
-
*
|
180
|
+
*Alex Ghiculescu*, *Oliver Peate*
|
377
181
|
|
378
|
-
* Cache `ActiveSupport::TimeWithZone#to_datetime` before freezing.
|
379
182
|
|
380
|
-
|
183
|
+
## Rails 7.0.0.alpha2 (September 15, 2021) ##
|
381
184
|
|
382
|
-
*
|
185
|
+
* No changes.
|
383
186
|
|
384
|
-
*Rafael Mendonça França*
|
385
187
|
|
386
|
-
|
188
|
+
## Rails 7.0.0.alpha1 (September 15, 2021) ##
|
387
189
|
|
388
|
-
|
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.
|
389
191
|
|
390
|
-
*
|
391
|
-
on `set_callback` and `skip_callback`.
|
192
|
+
*Xavier Noria*
|
392
193
|
|
393
|
-
|
194
|
+
* Private internal classes of `ActiveSupport::Dependencies` have been deleted, like `ActiveSupport::Dependencies::Reference`, `ActiveSupport::Dependencies::Blamable`, and others.
|
394
195
|
|
395
|
-
*
|
196
|
+
*Xavier Noria*
|
396
197
|
|
397
|
-
|
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.
|
398
199
|
|
399
|
-
*
|
200
|
+
*Xavier Noria*
|
400
201
|
|
401
|
-
|
202
|
+
* Improves the performance of `ActiveSupport::NumberHelper` formatters by avoiding the use of exceptions as flow control.
|
402
203
|
|
403
|
-
|
204
|
+
*Mike Dalessio*
|
404
205
|
|
405
|
-
|
406
|
-
"👩👩👧👦".mb_chars.reverse # => "👦👧👩👩"
|
206
|
+
* Removed rescue block from `ActiveSupport::Cache::RedisCacheStore#handle_exception`
|
407
207
|
|
408
|
-
|
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.
|
409
211
|
|
410
|
-
|
411
|
-
"👩👩👧👦".mb_chars.reverse # => "👩👩👧👦"
|
212
|
+
*Nicholas A. Stuart*
|
412
213
|
|
413
|
-
|
214
|
+
* Allow entirely opting out of deprecation warnings.
|
414
215
|
|
415
|
-
|
416
|
-
|
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.
|
417
219
|
|
418
|
-
|
220
|
+
Now, you can make `ActiveSupport::Deprecation.warn` a no-op:
|
419
221
|
|
420
|
-
|
421
|
-
|
222
|
+
```ruby
|
223
|
+
config.active_support.report_deprecations = false
|
224
|
+
```
|
422
225
|
|
423
|
-
|
226
|
+
This is the default in production for new apps. It is the equivalent to:
|
424
227
|
|
425
|
-
|
228
|
+
```ruby
|
229
|
+
config.active_support.deprecation = :silence
|
230
|
+
config.active_support.disallowed_deprecation = :silence
|
231
|
+
```
|
426
232
|
|
427
|
-
|
233
|
+
but will take a more optimised code path.
|
428
234
|
|
429
|
-
|
430
|
-
Fixed length in seconds is assigned to each duration part during parsing.
|
235
|
+
*Alex Ghiculescu*
|
431
236
|
|
432
|
-
|
237
|
+
* Faster tests by parallelizing only when overhead is justified by the number
|
238
|
+
of them.
|
433
239
|
|
434
|
-
|
435
|
-
|
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.
|
436
243
|
|
437
|
-
|
438
|
-
|
439
|
-
and nonsensical ones like `30.days == 1.month` to be `false`.
|
244
|
+
This threshold is 50 by default, and is configurable via config setting in
|
245
|
+
your test.rb:
|
440
246
|
|
441
|
-
|
442
|
-
|
247
|
+
```ruby
|
248
|
+
config.active_support.test_parallelization_threshold = 100
|
249
|
+
```
|
443
250
|
|
444
|
-
|
445
|
-
to avoid duplication of duration constants through the codebase and
|
446
|
-
eliminate creation of intermediate durations.
|
251
|
+
It's also configurable at the test case level:
|
447
252
|
|
448
|
-
|
253
|
+
```ruby
|
254
|
+
class ActiveSupport::TestCase
|
255
|
+
parallelize threshold: 100
|
256
|
+
end
|
257
|
+
```
|
449
258
|
|
450
|
-
*
|
451
|
-
to false.
|
259
|
+
*Jorge Manrubia*
|
452
260
|
|
453
|
-
|
261
|
+
* OpenSSL constants are now used for Digest computations.
|
454
262
|
|
455
|
-
*
|
456
|
-
`TrueClass#duplicable?`, `Symbol#duplicable?` and `Numeric#duplicable?`
|
457
|
-
to true with Ruby 2.4+. These classes can dup with Ruby 2.4+.
|
263
|
+
*Dirkjan Bussink*
|
458
264
|
|
459
|
-
|
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`.
|
460
268
|
|
461
|
-
|
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
|
+
```
|
462
273
|
|
463
|
-
*
|
274
|
+
*Steve Laing*
|
464
275
|
|
465
|
-
*
|
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.
|
466
279
|
|
467
|
-
|
280
|
+
Fixes [#42467](https://github.com/rails/rails/issues/42467).
|
468
281
|
|
469
|
-
*
|
282
|
+
*Alex Ghiculescu*
|
470
283
|
|
471
|
-
|
284
|
+
* Allow serializing any module or class to JSON by name.
|
472
285
|
|
473
|
-
*
|
286
|
+
*Tyler Rick*, *Zachary Scott*
|
474
287
|
|
475
|
-
|
288
|
+
* Raise `ActiveSupport::EncryptedFile::MissingKeyError` when the
|
289
|
+
`RAILS_MASTER_KEY` environment variable is blank (e.g. `""`).
|
476
290
|
|
477
|
-
*
|
291
|
+
*Sunny Ripert*
|
478
292
|
|
479
|
-
|
293
|
+
* The `from:` option is added to `ActiveSupport::TestCase#assert_no_changes`.
|
480
294
|
|
481
|
-
|
482
|
-
`Module.qualified_const_get` and `Module.qualified_const_set`.
|
295
|
+
It permits asserting on the initial value that is expected not to change.
|
483
296
|
|
484
|
-
|
297
|
+
```ruby
|
298
|
+
assert_no_changes -> { Status.all_good? }, from: true do
|
299
|
+
post :create, params: { status: { ok: true } }
|
300
|
+
end
|
301
|
+
```
|
485
302
|
|
486
|
-
*
|
303
|
+
*George Claghorn*
|
487
304
|
|
488
|
-
|
305
|
+
* Deprecate `ActiveSupport::SafeBuffer`'s incorrect implicit conversion of objects into string.
|
489
306
|
|
490
|
-
|
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.
|
491
312
|
|
492
|
-
*
|
313
|
+
*Jean Boussier*
|
493
314
|
|
494
|
-
*
|
315
|
+
* Allow nested access to keys on `Rails.application.credentials`.
|
495
316
|
|
496
|
-
|
317
|
+
Previously only top level keys in `credentials.yml.enc` could be accessed with method calls. Now any key can.
|
497
318
|
|
498
|
-
|
319
|
+
For example, given these secrets:
|
499
320
|
|
500
|
-
|
321
|
+
```yml
|
322
|
+
aws:
|
323
|
+
access_key_id: 123
|
324
|
+
secret_access_key: 345
|
325
|
+
```
|
501
326
|
|
502
|
-
|
327
|
+
`Rails.application.credentials.aws.access_key_id` will now return the same thing as
|
328
|
+
`Rails.application.credentials.aws[:access_key_id]`.
|
503
329
|
|
504
|
-
*
|
330
|
+
*Alex Ghiculescu*
|
505
331
|
|
506
|
-
*
|
332
|
+
* Added a faster and more compact `ActiveSupport::Cache` serialization format.
|
507
333
|
|
508
|
-
|
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.
|
509
339
|
|
510
|
-
*
|
340
|
+
*Jean Boussier*
|
511
341
|
|
512
|
-
|
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.
|
513
345
|
|
514
|
-
*
|
346
|
+
*Asherah Connor*
|
515
347
|
|
516
|
-
|
348
|
+
* Freeze `ActiveSupport::Duration#parts` and remove writer methods.
|
517
349
|
|
518
|
-
|
350
|
+
Durations are meant to be value objects and should not be mutated.
|
519
351
|
|
520
352
|
*Andrew White*
|
521
353
|
|
522
|
-
*
|
523
|
-
|
524
|
-
*Andrew White*
|
354
|
+
* Fix `ActiveSupport::TimeZone#utc_to_local` with fractional seconds.
|
525
355
|
|
526
|
-
|
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.
|
527
360
|
|
528
361
|
*Andrew White*
|
529
362
|
|
530
|
-
*
|
531
|
-
|
532
|
-
Previously `ActiveSupport::Duration.parse` used `Time.current` and
|
533
|
-
`Time#advance` to calculate the number of seconds in the duration
|
534
|
-
from an arbitrary collection of parts. However as `advance` tries to
|
535
|
-
be consistent across DST boundaries this meant that either the
|
536
|
-
duration was shorter or longer depending on the time of year.
|
363
|
+
* Add `expires_at` argument to `ActiveSupport::Cache` `write` and `fetch` to set a cache entry TTL as an absolute time.
|
537
364
|
|
538
|
-
|
539
|
-
|
540
|
-
|
365
|
+
```ruby
|
366
|
+
Rails.cache.write(key, value, expires_at: Time.now.at_end_of_hour)
|
367
|
+
```
|
541
368
|
|
542
|
-
|
543
|
-
are no longer creating instances of `ActiveSupport::TimeWithZone`
|
544
|
-
every time we parse a duration string.
|
369
|
+
*Jean Boussier*
|
545
370
|
|
546
|
-
|
371
|
+
* Deprecate `ActiveSupport::TimeWithZone.name` so that from Rails 7.1 it will use the default implementation.
|
547
372
|
|
548
373
|
*Andrew White*
|
549
374
|
|
550
|
-
*
|
551
|
-
|
552
|
-
|
553
|
-
*Prathamesh Sonpatki*
|
554
|
-
|
555
|
-
* Fix `ActiveSupport::TimeZone#strptime`.
|
556
|
-
Support for timestamps in format of seconds (%s) and milliseconds (%Q).
|
557
|
-
|
558
|
-
Fixes #26840.
|
375
|
+
* Deprecates Rails custom `Enumerable#sum` and `Array#sum` in favor of Ruby's native implementation which
|
376
|
+
is considerably faster.
|
559
377
|
|
560
|
-
|
378
|
+
Ruby requires an initializer for non-numeric type as per examples below:
|
561
379
|
|
562
|
-
|
380
|
+
```ruby
|
381
|
+
%w[foo bar].sum('')
|
382
|
+
# instead of %w[foo bar].sum
|
563
383
|
|
564
|
-
|
384
|
+
[[1, 2], [3, 4, 5]].sum([])
|
385
|
+
# instead of [[1, 2], [3, 4, 5]].sum
|
386
|
+
```
|
565
387
|
|
566
|
-
*
|
388
|
+
*Alberto Mota*
|
567
389
|
|
568
|
-
*
|
390
|
+
* Tests parallelization is now disabled when running individual files to prevent the setup overhead.
|
569
391
|
|
570
|
-
|
571
|
-
method `Time#since` via `method_missing`. It is now aliased to
|
572
|
-
the DST aware `ActiveSupport::TimeWithZone#+` which handles
|
573
|
-
transitions across DST boundaries, e.g:
|
392
|
+
It can still be enforced if the environment variable `PARALLEL_WORKERS` is present and set to a value greater than 1.
|
574
393
|
|
575
|
-
|
394
|
+
*Ricardo Díaz*
|
576
395
|
|
577
|
-
|
578
|
-
# => Sun, 06 Nov 2016 01:00:00 EDT -05:00
|
396
|
+
* Fix proxying keyword arguments in `ActiveSupport::CurrentAttributes`.
|
579
397
|
|
580
|
-
|
581
|
-
# => Sun, 06 Nov 2016 01:00:00 EST -05:00
|
398
|
+
*Marcin Kołodziej*
|
582
399
|
|
583
|
-
|
400
|
+
* Add `Enumerable#maximum` and `Enumerable#minimum` to easily calculate the maximum or minimum from extracted
|
401
|
+
elements of an enumerable.
|
584
402
|
|
585
|
-
|
403
|
+
```ruby
|
404
|
+
payments = [Payment.new(5), Payment.new(15), Payment.new(10)]
|
586
405
|
|
587
|
-
|
588
|
-
|
589
|
-
|
406
|
+
payments.minimum(:price) # => 5
|
407
|
+
payments.maximum(:price) # => 15
|
408
|
+
```
|
590
409
|
|
591
|
-
|
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.
|
592
412
|
|
593
|
-
*
|
413
|
+
*Ayrton De Craene*
|
594
414
|
|
595
|
-
|
596
|
-
longer changes the value of the parent class. This brings the
|
597
|
-
behavior inline with the documentation.
|
415
|
+
* `ActiveSupport::Cache::MemCacheStore` now accepts an explicit `nil` for its `addresses` argument.
|
598
416
|
|
599
|
-
|
417
|
+
```ruby
|
418
|
+
config.cache_store = :mem_cache_store, nil
|
600
419
|
|
601
|
-
|
602
|
-
thread_mattr_accessor :user
|
603
|
-
end
|
420
|
+
# is now equivalent to
|
604
421
|
|
605
|
-
|
606
|
-
end
|
422
|
+
config.cache_store = :mem_cache_store
|
607
423
|
|
608
|
-
|
609
|
-
Customer.user = "Rafael"
|
424
|
+
# and is also equivalent to
|
610
425
|
|
611
|
-
|
426
|
+
config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211"
|
612
427
|
|
613
|
-
|
428
|
+
# which is the fallback behavior of Dalli
|
429
|
+
```
|
614
430
|
|
615
|
-
|
431
|
+
This helps those migrating from `:dalli_store`, where an explicit `nil` was permitted.
|
616
432
|
|
617
|
-
|
433
|
+
*Michael Overmeyer*
|
618
434
|
|
619
|
-
|
435
|
+
* Add `Enumerable#in_order_of` to put an Enumerable in a certain order by a key.
|
620
436
|
|
621
|
-
*
|
622
|
-
parts that `ActiveSupport::TimeWithZone` will recognize as possibly being
|
623
|
-
of variable duration to take account of DST transitions.
|
437
|
+
*DHH*
|
624
438
|
|
625
|
-
|
439
|
+
* `ActiveSupport::Inflector.camelize` behaves expected when provided a symbol `:upper` or `:lower` argument. Matches
|
440
|
+
`String#camelize` behavior.
|
626
441
|
|
627
|
-
*
|
628
|
-
|
629
|
-
* Defines `Regexp.match?` for Ruby versions prior to 2.4. The predicate
|
630
|
-
has the same interface, but it does not have the performance boost. Its
|
631
|
-
purpose is to be able to write 2.4 compatible code.
|
632
|
-
|
633
|
-
*Xavier Noria*
|
442
|
+
*Alex Ghiculescu*
|
634
443
|
|
635
|
-
*
|
636
|
-
|
637
|
-
AEAD modes like `aes-256-gcm` provide both confidentiality and data
|
638
|
-
authenticity, eliminating the need to use `MessageVerifier` to check if the
|
639
|
-
encrypted data has been tampered with. This speeds up encryption/decryption
|
640
|
-
and results in shorter cipher text.
|
641
|
-
|
642
|
-
*Bart de Water*
|
643
|
-
|
644
|
-
* Introduce `assert_changes` and `assert_no_changes`.
|
645
|
-
|
646
|
-
`assert_changes` is a more general `assert_difference` that works with any
|
647
|
-
value.
|
648
|
-
|
649
|
-
assert_changes 'Error.current', from: nil, to: 'ERR' do
|
650
|
-
expected_bad_operation
|
651
|
-
end
|
652
|
-
|
653
|
-
Can be called with strings, to be evaluated in the binding (context) of
|
654
|
-
the block given to the assertion, or a lambda.
|
655
|
-
|
656
|
-
assert_changes -> { Error.current }, from: nil, to: 'ERR' do
|
657
|
-
expected_bad_operation
|
658
|
-
end
|
659
|
-
|
660
|
-
The `from` and `to` arguments are compared with the case operator (`===`).
|
661
|
-
|
662
|
-
assert_changes 'Error.current', from: nil, to: Error do
|
663
|
-
expected_bad_operation
|
664
|
-
end
|
665
|
-
|
666
|
-
This is pretty useful, if you need to loosely compare a value. For example,
|
667
|
-
you need to test a token has been generated and it has that many random
|
668
|
-
characters.
|
669
|
-
|
670
|
-
user = User.start_registration
|
671
|
-
assert_changes 'user.token', to: /\w{32}/ do
|
672
|
-
user.finish_registration
|
673
|
-
end
|
674
|
-
|
675
|
-
*Genadi Samokovarov*
|
676
|
-
|
677
|
-
* Fix `ActiveSupport::TimeZone#strptime`. Now raises `ArgumentError` when the
|
678
|
-
given time doesn't match the format. The error is the same as the one given
|
679
|
-
by Ruby's `Date.strptime`. Previously it raised
|
680
|
-
`NoMethodError: undefined method empty? for nil:NilClass.` due to a bug.
|
681
|
-
|
682
|
-
Fixes #25701.
|
683
|
-
|
684
|
-
*John Gesimondo*
|
685
|
-
|
686
|
-
* `travel/travel_to` travel time helpers, now raise on nested calls,
|
687
|
-
as this can lead to confusing time stubbing.
|
688
|
-
|
689
|
-
Instead of:
|
690
|
-
|
691
|
-
travel_to 2.days.from_now do
|
692
|
-
# 2 days from today
|
693
|
-
travel_to 3.days.from_now do
|
694
|
-
# 5 days from today
|
695
|
-
end
|
696
|
-
end
|
697
|
-
|
698
|
-
preferred way to achieve above is:
|
699
|
-
|
700
|
-
travel 2.days do
|
701
|
-
# 2 days from today
|
702
|
-
end
|
703
|
-
|
704
|
-
travel 5.days do
|
705
|
-
# 5 days from today
|
706
|
-
end
|
444
|
+
* Raises an `ArgumentError` when the first argument of `ActiveSupport::Notification.subscribe` is
|
445
|
+
invalid.
|
707
446
|
|
708
447
|
*Vipul A M*
|
709
448
|
|
710
|
-
*
|
711
|
-
`ActiveSupport::JSON.decode` when `parse_json_times` is enabled.
|
712
|
-
Strings in the format of `YYYY-MM-DD hh:mm:ss` (without a `Z` at
|
713
|
-
the end) will be parsed in the local timezone (`Time.zone`). In
|
714
|
-
addition, date strings (`YYYY-MM-DD`) are now parsed into `Date`
|
715
|
-
objects.
|
716
|
-
|
717
|
-
*Grzegorz Witek*
|
718
|
-
|
719
|
-
* Fixed `ActiveSupport::Logger.broadcast` so that calls to `#silence` now
|
720
|
-
properly delegate to all loggers. Silencing now properly suppresses logging
|
721
|
-
to both the log and the console.
|
722
|
-
|
723
|
-
*Kevin McPhillips*
|
724
|
-
|
725
|
-
* Remove deprecated arguments in `assert_nothing_raised`.
|
726
|
-
|
727
|
-
*Rafel Mendonça França*
|
728
|
-
|
729
|
-
* `Date.to_s` doesn't produce too many spaces. For example, `to_s(:short)`
|
730
|
-
will now produce `01 Feb` instead of ` 1 Feb`.
|
731
|
-
|
732
|
-
Fixes #25251.
|
733
|
-
|
734
|
-
*Sean Griffin*
|
735
|
-
|
736
|
-
* Introduce `Module#delegate_missing_to`.
|
737
|
-
|
738
|
-
When building a decorator, a common pattern emerges:
|
739
|
-
|
740
|
-
class Partition
|
741
|
-
def initialize(first_event)
|
742
|
-
@events = [ first_event ]
|
743
|
-
end
|
744
|
-
|
745
|
-
def people
|
746
|
-
if @events.first.detail.people.any?
|
747
|
-
@events.collect { |e| Array(e.detail.people) }.flatten.uniq
|
748
|
-
else
|
749
|
-
@events.collect(&:creator).uniq
|
750
|
-
end
|
751
|
-
end
|
752
|
-
|
753
|
-
private
|
754
|
-
def respond_to_missing?(name, include_private = false)
|
755
|
-
@events.respond_to?(name, include_private)
|
756
|
-
end
|
757
|
-
|
758
|
-
def method_missing(method, *args, &block)
|
759
|
-
@events.send(method, *args, &block)
|
760
|
-
end
|
761
|
-
end
|
762
|
-
|
763
|
-
With `Module#delegate_missing_to`, the above is condensed to:
|
449
|
+
* `HashWithIndifferentAccess#deep_transform_keys` now returns a `HashWithIndifferentAccess` instead of a `Hash`.
|
764
450
|
|
765
|
-
|
766
|
-
delegate_missing_to :@events
|
451
|
+
*Nathaniel Woodthorpe*
|
767
452
|
|
768
|
-
|
769
|
-
@events = [ first_event ]
|
770
|
-
end
|
453
|
+
* Consume dalli’s `cache_nils` configuration as `ActiveSupport::Cache`'s `skip_nil` when using `MemCacheStore`.
|
771
454
|
|
772
|
-
|
773
|
-
if @events.first.detail.people.any?
|
774
|
-
@events.collect { |e| Array(e.detail.people) }.flatten.uniq
|
775
|
-
else
|
776
|
-
@events.collect(&:creator).uniq
|
777
|
-
end
|
778
|
-
end
|
779
|
-
end
|
455
|
+
*Ritikesh G*
|
780
456
|
|
781
|
-
|
457
|
+
* Add `RedisCacheStore#stats` method similar to `MemCacheStore#stats`. Calls `redis#info` internally.
|
782
458
|
|
783
|
-
*
|
784
|
-
matching the exception's cause.
|
459
|
+
*Ritikesh G*
|
785
460
|
|
786
|
-
*Jeremy Daer*
|
787
461
|
|
788
|
-
Please check [
|
462
|
+
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/activesupport/CHANGELOG.md) for previous changes.
|