activesupport 6.1.0 → 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.

Files changed (183) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +263 -352
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +1 -1
  5. data/lib/active_support/actionable_error.rb +1 -1
  6. data/lib/active_support/array_inquirer.rb +0 -2
  7. data/lib/active_support/backtrace_cleaner.rb +2 -2
  8. data/lib/active_support/benchmarkable.rb +2 -2
  9. data/lib/active_support/cache/file_store.rb +16 -10
  10. data/lib/active_support/cache/mem_cache_store.rb +154 -39
  11. data/lib/active_support/cache/memory_store.rb +24 -16
  12. data/lib/active_support/cache/null_store.rb +10 -2
  13. data/lib/active_support/cache/redis_cache_store.rb +59 -78
  14. data/lib/active_support/cache/strategy/local_cache.rb +38 -61
  15. data/lib/active_support/cache.rb +306 -148
  16. data/lib/active_support/callbacks.rb +184 -85
  17. data/lib/active_support/code_generator.rb +65 -0
  18. data/lib/active_support/concern.rb +5 -5
  19. data/lib/active_support/concurrency/load_interlock_aware_monitor.rb +2 -4
  20. data/lib/active_support/concurrency/share_lock.rb +2 -2
  21. data/lib/active_support/configurable.rb +8 -5
  22. data/lib/active_support/configuration_file.rb +7 -2
  23. data/lib/active_support/core_ext/array/access.rb +1 -5
  24. data/lib/active_support/core_ext/array/conversions.rb +13 -12
  25. data/lib/active_support/core_ext/array/deprecated_conversions.rb +25 -0
  26. data/lib/active_support/core_ext/array/grouping.rb +6 -6
  27. data/lib/active_support/core_ext/array/inquiry.rb +2 -2
  28. data/lib/active_support/core_ext/array.rb +1 -0
  29. data/lib/active_support/core_ext/big_decimal/conversions.rb +1 -1
  30. data/lib/active_support/core_ext/class/subclasses.rb +25 -17
  31. data/lib/active_support/core_ext/date/blank.rb +1 -1
  32. data/lib/active_support/core_ext/date/calculations.rb +9 -9
  33. data/lib/active_support/core_ext/date/conversions.rb +14 -14
  34. data/lib/active_support/core_ext/date/deprecated_conversions.rb +26 -0
  35. data/lib/active_support/core_ext/date.rb +1 -0
  36. data/lib/active_support/core_ext/date_and_time/calculations.rb +4 -4
  37. data/lib/active_support/core_ext/date_and_time/compatibility.rb +1 -1
  38. data/lib/active_support/core_ext/date_time/blank.rb +1 -1
  39. data/lib/active_support/core_ext/date_time/conversions.rb +13 -13
  40. data/lib/active_support/core_ext/date_time/deprecated_conversions.rb +22 -0
  41. data/lib/active_support/core_ext/date_time.rb +1 -0
  42. data/lib/active_support/core_ext/digest/uuid.rb +39 -13
  43. data/lib/active_support/core_ext/enumerable.rb +101 -32
  44. data/lib/active_support/core_ext/file/atomic.rb +3 -1
  45. data/lib/active_support/core_ext/hash/conversions.rb +0 -1
  46. data/lib/active_support/core_ext/hash/indifferent_access.rb +3 -3
  47. data/lib/active_support/core_ext/hash/keys.rb +1 -1
  48. data/lib/active_support/core_ext/kernel/reporting.rb +4 -4
  49. data/lib/active_support/core_ext/kernel/singleton_class.rb +1 -1
  50. data/lib/active_support/core_ext/module/attribute_accessors.rb +2 -0
  51. data/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb +19 -10
  52. data/lib/active_support/core_ext/module/delegation.rb +2 -8
  53. data/lib/active_support/core_ext/name_error.rb +2 -8
  54. data/lib/active_support/core_ext/numeric/conversions.rb +80 -77
  55. data/lib/active_support/core_ext/numeric/deprecated_conversions.rb +60 -0
  56. data/lib/active_support/core_ext/numeric.rb +1 -0
  57. data/lib/active_support/core_ext/object/acts_like.rb +29 -5
  58. data/lib/active_support/core_ext/object/blank.rb +2 -2
  59. data/lib/active_support/core_ext/object/deep_dup.rb +1 -1
  60. data/lib/active_support/core_ext/object/duplicable.rb +11 -0
  61. data/lib/active_support/core_ext/object/json.rb +37 -25
  62. data/lib/active_support/core_ext/object/to_query.rb +2 -2
  63. data/lib/active_support/core_ext/object/try.rb +20 -20
  64. data/lib/active_support/core_ext/object/with_options.rb +20 -1
  65. data/lib/active_support/core_ext/pathname/existence.rb +21 -0
  66. data/lib/active_support/core_ext/pathname.rb +3 -0
  67. data/lib/active_support/core_ext/range/compare_range.rb +0 -25
  68. data/lib/active_support/core_ext/range/conversions.rb +8 -8
  69. data/lib/active_support/core_ext/range/deprecated_conversions.rb +26 -0
  70. data/lib/active_support/core_ext/range/each.rb +1 -1
  71. data/lib/active_support/core_ext/range/include_time_with_zone.rb +4 -25
  72. data/lib/active_support/core_ext/range/overlaps.rb +1 -1
  73. data/lib/active_support/core_ext/range.rb +1 -1
  74. data/lib/active_support/core_ext/securerandom.rb +1 -1
  75. data/lib/active_support/core_ext/string/conversions.rb +2 -2
  76. data/lib/active_support/core_ext/string/filters.rb +1 -1
  77. data/lib/active_support/core_ext/string/inflections.rb +1 -1
  78. data/lib/active_support/core_ext/string/inquiry.rb +1 -1
  79. data/lib/active_support/core_ext/string/output_safety.rb +91 -39
  80. data/lib/active_support/core_ext/symbol/starts_ends_with.rb +0 -8
  81. data/lib/active_support/core_ext/time/calculations.rb +9 -7
  82. data/lib/active_support/core_ext/time/conversions.rb +14 -12
  83. data/lib/active_support/core_ext/time/deprecated_conversions.rb +22 -0
  84. data/lib/active_support/core_ext/time/zones.rb +7 -22
  85. data/lib/active_support/core_ext/time.rb +1 -0
  86. data/lib/active_support/core_ext/uri.rb +3 -27
  87. data/lib/active_support/core_ext.rb +2 -1
  88. data/lib/active_support/current_attributes.rb +32 -14
  89. data/lib/active_support/dependencies/interlock.rb +10 -18
  90. data/lib/active_support/dependencies/require_dependency.rb +28 -0
  91. data/lib/active_support/dependencies.rb +58 -788
  92. data/lib/active_support/deprecation/behaviors.rb +8 -5
  93. data/lib/active_support/deprecation/method_wrappers.rb +3 -3
  94. data/lib/active_support/deprecation/proxy_wrappers.rb +2 -2
  95. data/lib/active_support/deprecation.rb +2 -2
  96. data/lib/active_support/descendants_tracker.rb +174 -68
  97. data/lib/active_support/digest.rb +5 -3
  98. data/lib/active_support/duration/iso8601_parser.rb +3 -3
  99. data/lib/active_support/duration/iso8601_serializer.rb +9 -1
  100. data/lib/active_support/duration.rb +81 -51
  101. data/lib/active_support/encrypted_configuration.rb +13 -2
  102. data/lib/active_support/encrypted_file.rb +13 -1
  103. data/lib/active_support/environment_inquirer.rb +1 -1
  104. data/lib/active_support/error_reporter.rb +117 -0
  105. data/lib/active_support/evented_file_update_checker.rb +3 -5
  106. data/lib/active_support/execution_context/test_helper.rb +13 -0
  107. data/lib/active_support/execution_context.rb +53 -0
  108. data/lib/active_support/execution_wrapper.rb +43 -21
  109. data/lib/active_support/executor/test_helper.rb +7 -0
  110. data/lib/active_support/fork_tracker.rb +19 -10
  111. data/lib/active_support/gem_version.rb +5 -5
  112. data/lib/active_support/hash_with_indifferent_access.rb +9 -2
  113. data/lib/active_support/html_safe_translation.rb +43 -0
  114. data/lib/active_support/i18n.rb +1 -0
  115. data/lib/active_support/i18n_railtie.rb +1 -1
  116. data/lib/active_support/inflector/inflections.rb +23 -7
  117. data/lib/active_support/inflector/methods.rb +24 -48
  118. data/lib/active_support/inflector/transliterate.rb +1 -1
  119. data/lib/active_support/isolated_execution_state.rb +72 -0
  120. data/lib/active_support/json/encoding.rb +3 -3
  121. data/lib/active_support/key_generator.rb +22 -5
  122. data/lib/active_support/lazy_load_hooks.rb +28 -4
  123. data/lib/active_support/locale/en.yml +2 -2
  124. data/lib/active_support/log_subscriber/test_helper.rb +2 -2
  125. data/lib/active_support/log_subscriber.rb +15 -5
  126. data/lib/active_support/logger_thread_safe_level.rb +4 -13
  127. data/lib/active_support/message_encryptor.rb +12 -6
  128. data/lib/active_support/message_verifier.rb +46 -14
  129. data/lib/active_support/messages/metadata.rb +2 -2
  130. data/lib/active_support/multibyte/chars.rb +10 -11
  131. data/lib/active_support/multibyte/unicode.rb +0 -12
  132. data/lib/active_support/multibyte.rb +1 -1
  133. data/lib/active_support/notifications/fanout.rb +91 -65
  134. data/lib/active_support/notifications/instrumenter.rb +32 -15
  135. data/lib/active_support/notifications.rb +24 -24
  136. data/lib/active_support/number_helper/number_converter.rb +1 -3
  137. data/lib/active_support/number_helper/number_to_currency_converter.rb +11 -6
  138. data/lib/active_support/number_helper/number_to_delimited_converter.rb +1 -1
  139. data/lib/active_support/number_helper/number_to_human_size_converter.rb +1 -1
  140. data/lib/active_support/number_helper/number_to_phone_converter.rb +1 -1
  141. data/lib/active_support/number_helper/number_to_rounded_converter.rb +10 -6
  142. data/lib/active_support/number_helper/rounding_helper.rb +2 -6
  143. data/lib/active_support/number_helper.rb +0 -2
  144. data/lib/active_support/option_merger.rb +10 -18
  145. data/lib/active_support/ordered_hash.rb +1 -1
  146. data/lib/active_support/ordered_options.rb +1 -1
  147. data/lib/active_support/parameter_filter.rb +6 -1
  148. data/lib/active_support/per_thread_registry.rb +5 -0
  149. data/lib/active_support/railtie.rb +69 -19
  150. data/lib/active_support/reloader.rb +1 -1
  151. data/lib/active_support/rescuable.rb +16 -16
  152. data/lib/active_support/ruby_features.rb +7 -0
  153. data/lib/active_support/secure_compare_rotator.rb +2 -2
  154. data/lib/active_support/security_utils.rb +1 -1
  155. data/lib/active_support/string_inquirer.rb +0 -2
  156. data/lib/active_support/subscriber.rb +7 -18
  157. data/lib/active_support/tagged_logging.rb +2 -2
  158. data/lib/active_support/test_case.rb +13 -21
  159. data/lib/active_support/testing/assertions.rb +36 -6
  160. data/lib/active_support/testing/deprecation.rb +52 -1
  161. data/lib/active_support/testing/isolation.rb +2 -2
  162. data/lib/active_support/testing/method_call_assertions.rb +5 -5
  163. data/lib/active_support/testing/parallelization/server.rb +4 -0
  164. data/lib/active_support/testing/parallelization/worker.rb +3 -0
  165. data/lib/active_support/testing/parallelization.rb +4 -0
  166. data/lib/active_support/testing/parallelize_executor.rb +76 -0
  167. data/lib/active_support/testing/stream.rb +3 -5
  168. data/lib/active_support/testing/tagged_logging.rb +1 -1
  169. data/lib/active_support/testing/time_helpers.rb +13 -2
  170. data/lib/active_support/time_with_zone.rb +60 -20
  171. data/lib/active_support/values/time_zone.rb +36 -15
  172. data/lib/active_support/version.rb +1 -1
  173. data/lib/active_support/xml_mini/jdom.rb +1 -1
  174. data/lib/active_support/xml_mini/libxml.rb +5 -5
  175. data/lib/active_support/xml_mini/libxmlsax.rb +1 -1
  176. data/lib/active_support/xml_mini/nokogiri.rb +4 -4
  177. data/lib/active_support/xml_mini/nokogirisax.rb +1 -1
  178. data/lib/active_support/xml_mini/rexml.rb +1 -1
  179. data/lib/active_support/xml_mini.rb +5 -4
  180. data/lib/active_support.rb +17 -1
  181. metadata +29 -26
  182. data/lib/active_support/core_ext/marshal.rb +0 -26
  183. data/lib/active_support/dependencies/zeitwerk_integration.rb +0 -117
data/CHANGELOG.md CHANGED
@@ -1,551 +1,462 @@
1
- ## Rails 6.1.0 (December 09, 2020) ##
1
+ ## Rails 7.0.4.1 (January 17, 2023) ##
2
2
 
3
- * Ensure `MemoryStore` disables compression by default. Reverts behavior of
4
- `MemoryStore` to its prior rails `5.1` behavior.
3
+ * Avoid regex backtracking in Inflector.underscore
5
4
 
6
- *Max Gurewitz*
5
+ [CVE-2023-22796]
7
6
 
8
- * Calling `iso8601` on negative durations retains the negative sign on individual
9
- digits instead of prepending it.
10
7
 
11
- This change is required so we can interoperate with PostgreSQL, which prefers
12
- negative signs for each component.
8
+ ## Rails 7.0.4 (September 09, 2022) ##
13
9
 
14
- Compatibility with other iso8601 parsers which support leading negatives as well
15
- as negatives per component is still retained.
10
+ * Redis cache store is now compatible with redis-rb 5.0.
16
11
 
17
- Before:
12
+ *Jean Boussier*
18
13
 
19
- (-1.year - 1.day).iso8601
20
- # => "-P1Y1D"
14
+ * Fix `NoMethodError` on custom `ActiveSupport::Deprecation` behavior.
21
15
 
22
- After:
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.
23
19
 
24
- (-1.year - 1.day).iso8601
25
- # => "P-1Y-1D"
20
+ This change removes this `arity` restriction of custom behaviors.
26
21
 
27
- *Vipul A M*
22
+ *Ryo Nakamura*
28
23
 
29
- * Remove deprecated `ActiveSupport::Notifications::Instrumenter#end=`.
30
24
 
31
- *Rafael Mendonça França*
25
+ ## Rails 7.0.3.1 (July 12, 2022) ##
32
26
 
33
- * Deprecate `ActiveSupport::Multibyte::Unicode.default_normalization_form`.
27
+ * No changes.
34
28
 
35
- *Rafael Mendonça França*
36
29
 
37
- * Remove deprecated `ActiveSupport::Multibyte::Unicode.pack_graphemes`,
38
- `ActiveSupport::Multibyte::Unicode.unpack_graphemes`,
39
- `ActiveSupport::Multibyte::Unicode.normalize`,
40
- `ActiveSupport::Multibyte::Unicode.downcase`,
41
- `ActiveSupport::Multibyte::Unicode.upcase` and `ActiveSupport::Multibyte::Unicode.swapcase`.
30
+ ## Rails 7.0.3 (May 09, 2022) ##
42
31
 
43
- *Rafael Mendonça França*
32
+ * No changes.
44
33
 
45
- * Remove deprecated `ActiveSupport::Multibyte::Chars#consumes?` and `ActiveSupport::Multibyte::Chars#normalize`.
46
34
 
47
- *Rafael Mendonça França*
35
+ ## Rails 7.0.2.4 (April 26, 2022) ##
48
36
 
49
- * Remove deprecated file `active_support/core_ext/range/include_range`.
37
+ * Fix and add protections for XSS in `ActionView::Helpers` and `ERB::Util`.
50
38
 
51
- *Rafael Mendonça França*
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.
52
41
 
53
- * Remove deprecated file `active_support/core_ext/hash/transform_values`.
42
+ *Álvaro Martín Fraguas*
54
43
 
55
- *Rafael Mendonça França*
44
+ ## Rails 7.0.2.3 (March 08, 2022) ##
56
45
 
57
- * Remove deprecated file `active_support/core_ext/hash/compact`.
46
+ * No changes.
58
47
 
59
- *Rafael Mendonça França*
60
48
 
61
- * Remove deprecated file `active_support/core_ext/array/prepend_and_append`.
49
+ ## Rails 7.0.2.2 (February 11, 2022) ##
62
50
 
63
- *Rafael Mendonça França*
51
+ * Fix Reloader method signature to work with the new Executor signature
64
52
 
65
- * Remove deprecated file `active_support/core_ext/numeric/inquiry`.
66
53
 
67
- *Rafael Mendonça França*
54
+ ## Rails 7.0.2.1 (February 11, 2022) ##
68
55
 
69
- * Remove deprecated file `active_support/core_ext/module/reachable`.
56
+ * No changes.
70
57
 
71
- *Rafael Mendonça França*
72
58
 
73
- * Remove deprecated `Module#parent_name`, `Module#parent` and `Module#parents`.
59
+ ## Rails 7.0.2 (February 08, 2022) ##
74
60
 
75
- *Rafael Mendonça França*
61
+ * Fix `ActiveSupport::EncryptedConfiguration` to be compatible with Psych 4
76
62
 
77
- * Remove deprecated `ActiveSupport::LoggerThreadSafeLevel#after_initialize`.
63
+ *Stephen Sugden*
78
64
 
79
- *Rafael Mendonça França*
65
+ * Improve `File.atomic_write` error handling.
80
66
 
81
- * Remove deprecated `LoggerSilence` constant.
67
+ *Daniel Pepper*
82
68
 
83
- *Rafael Mendonça França*
84
69
 
85
- * Remove deprecated fallback to `I18n.default_local` when `config.i18n.fallbacks` is empty.
70
+ ## Rails 7.0.1 (January 06, 2022) ##
86
71
 
87
- *Rafael Mendonça França*
72
+ * Fix `Class#descendants` and `DescendantsTracker#descendants` compatibility with Ruby 3.1.
88
73
 
89
- * Remove entries from local cache on `RedisCacheStore#delete_matched`
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.
90
76
 
91
- Fixes #38627
77
+ *Jean Boussier*
92
78
 
93
- *ojab*
94
79
 
95
- * Speed up `ActiveSupport::SecurityUtils.fixed_length_secure_compare` by using
96
- `OpenSSL.fixed_length_secure_compare`, if available.
80
+ ## Rails 7.0.0 (December 15, 2021) ##
97
81
 
98
- *Nate Matykiewicz*
82
+ * Fix `ActiveSupport::Duration.build` to support negative values.
99
83
 
100
- * `ActiveSupport::Cache::MemCacheStore` now checks `ENV["MEMCACHE_SERVERS"]` before falling back to `"localhost:11211"` if configured without any addresses.
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`).
101
88
 
102
- ```ruby
103
- config.cache_store = :mem_cache_store
89
+ *Caleb Buxton*, *Braden Staudacher*
104
90
 
105
- # is now equivalent to
106
91
 
107
- config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211"
92
+ ## Rails 7.0.0.rc3 (December 14, 2021) ##
108
93
 
109
- # instead of
94
+ * No changes.
110
95
 
111
- config.cache_store = :mem_cache_store, "localhost:11211" # ignores ENV["MEMCACHE_SERVERS"]
112
- ```
113
96
 
114
- *Sam Bostock*
97
+ ## Rails 7.0.0.rc2 (December 14, 2021) ##
115
98
 
116
- * `ActiveSupport::Subscriber#attach_to` now accepts an `inherit_all:` argument. When set to true,
117
- it allows a subscriber to receive events for methods defined in the subscriber's ancestor class(es).
99
+ * No changes.
118
100
 
119
- ```ruby
120
- class ActionControllerSubscriber < ActiveSupport::Subscriber
121
- attach_to :action_controller
101
+ ## Rails 7.0.0.rc1 (December 06, 2021) ##
122
102
 
123
- def start_processing(event)
124
- info "Processing by #{event.payload[:controller]}##{event.payload[:action]} as #{format}"
125
- end
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`.
126
105
 
127
- def redirect_to(event)
128
- info { "Redirected to #{event.payload[:location]}" }
129
- end
130
- end
106
+ *Rafael Mendonça França*
131
107
 
132
- # We detach ActionControllerSubscriber from the :action_controller namespace so that our CustomActionControllerSubscriber
133
- # can provide its own instrumentation for certain events in the namespace
134
- ActionControllerSubscriber.detach_from(:action_controller)
108
+ * Document `ActiveSupport::Testing::Deprecation`.
135
109
 
136
- class CustomActionControllerSubscriber < ActionControllerSubscriber
137
- attach_to :action_controller, inherit_all: true
110
+ *Sam Bostock & Sam Jordan*
138
111
 
139
- def start_processing(event)
140
- info "A custom response to start_processing events"
141
- end
112
+ * Add `Pathname#existence`.
142
113
 
143
- # => CustomActionControllerSubscriber will process events for "start_processing.action_controller" notifications
144
- # using its own #start_processing implementation, while retaining ActionControllerSubscriber's instrumentation
145
- # for "redirect_to.action_controller" notifications
146
- end
114
+ ```ruby
115
+ Pathname.new("file").existence&.read
147
116
  ```
148
117
 
149
- *Adrianna Chang*
118
+ *Timo Schilling*
150
119
 
151
- * Allow the digest class used to generate non-sensitive digests to be configured with `config.active_support.hash_digest_class`.
120
+ * Remove deprecate `ActiveSupport::Multibyte::Unicode.default_normalization_form`.
152
121
 
153
- `config.active_support.use_sha1_digests` is deprecated in favour of `config.active_support.hash_digest_class = ::Digest::SHA1`.
154
-
155
- *Dirkjan Bussink*
122
+ *Rafael Mendonça França*
156
123
 
157
- * Fix bug to make memcached write_entry expire correctly with unless_exist
124
+ * Remove deprecated support to use `Range#include?` to check the inclusion of a value in
125
+ a date time range is deprecated.
158
126
 
159
- *Jye Lee*
127
+ *Rafael Mendonça França*
160
128
 
161
- * Add `ActiveSupport::Duration` conversion methods
129
+ * Remove deprecated `URI.parser`.
162
130
 
163
- `in_seconds`, `in_minutes`, `in_hours`, `in_days`, `in_weeks`, `in_months`, and `in_years` return the respective duration covered.
131
+ *Rafael Mendonça França*
164
132
 
165
- *Jason York*
133
+ * Remove deprecated `config.active_support.use_sha1_digests`.
166
134
 
167
- * Fixed issue in `ActiveSupport::Cache::RedisCacheStore` not passing options
168
- to `read_multi` causing `fetch_multi` to not work properly
135
+ *Rafael Mendonça França*
169
136
 
170
- *Rajesh Sharma*
137
+ * Invoking `Object#with_options` without a `&block` argument returns the
138
+ `ActiveSupport::OptionMerger` instance.
171
139
 
172
- * Fixed issue in `ActiveSupport::Cache::MemCacheStore` which caused duplicate compression,
173
- and caused the provided `compression_threshold` to not be respected.
140
+ *Sean Doyle*
174
141
 
175
- *Max Gurewitz*
142
+ * `Rails.application.executor` hooks can now be called around every test
176
143
 
177
- * Prevent `RedisCacheStore` and `MemCacheStore` from performing compression
178
- when reading entries written with `raw: true`.
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.
179
146
 
180
- *Max Gurewitz*
147
+ However it requires the executor hooks executed in the test environment to be re-entrant.
181
148
 
182
- * `URI.parser` is deprecated and will be removed in Rails 6.2. Use
183
- `URI::DEFAULT_PARSER` instead.
149
+ To enable this, set `config.active_support.executor_around_test_case = true` (this is the default in Rails 7).
184
150
 
185
151
  *Jean Boussier*
186
152
 
187
- * `require_dependency` has been documented to be _obsolete_ in `:zeitwerk`
188
- mode. The method is not deprecated as such (yet), but applications are
189
- encouraged to not use it.
190
-
191
- In `:zeitwerk` mode, semantics match Ruby's and you do not need to be
192
- defensive with load order. Just refer to classes and modules normally. If
193
- the constant name is dynamic, camelize if needed, and constantize.
194
-
195
- *Xavier Noria*
196
-
197
- * Add 3rd person aliases of `Symbol#start_with?` and `Symbol#end_with?`.
198
-
199
- ```ruby
200
- :foo.starts_with?("f") # => true
201
- :foo.ends_with?("o") # => true
202
- ```
203
-
204
- *Ryuta Kamizono*
205
-
206
- * Add override of unary plus for `ActiveSupport::Duration`.
153
+ * `ActiveSupport::DescendantsTracker` now mostly delegate to `Class#descendants` on Ruby 3.1
207
154
 
208
- `+ 1.second` is now identical to `+1.second` to prevent errors
209
- where a seemingly innocent change of formatting leads to a change in the code behavior.
155
+ Ruby now provides a fast `Class#descendants` making `ActiveSupport::DescendantsTracker` mostly useless.
210
156
 
211
- Before:
212
- ```ruby
213
- +1.second.class
214
- # => ActiveSupport::Duration
215
- (+ 1.second).class
216
- # => Integer
217
- ```
157
+ As a result the following methods are deprecated:
218
158
 
219
- After:
220
- ```ruby
221
- +1.second.class
222
- # => ActiveSupport::Duration
223
- (+ 1.second).class
224
- # => ActiveSupport::Duration
225
- ```
159
+ - `ActiveSupport::DescendantsTracker.direct_descendants`
160
+ - `ActiveSupport::DescendantsTracker#direct_descendants`
226
161
 
227
- Fixes #39079.
162
+ *Jean Boussier*
228
163
 
229
- *Roman Kushnir*
164
+ * Fix the `Digest::UUID.uuid_from_hash` behavior for namespace IDs that are different from the ones defined on `Digest::UUID`.
230
165
 
231
- * Add subsec to `ActiveSupport::TimeWithZone#inspect`.
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.
232
169
 
233
- Before:
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.
234
174
 
235
- Time.at(1498099140).in_time_zone.inspect
236
- # => "Thu, 22 Jun 2017 02:39:00 UTC +00:00"
237
- Time.at(1498099140, 123456780, :nsec).in_time_zone.inspect
238
- # => "Thu, 22 Jun 2017 02:39:00 UTC +00:00"
239
- Time.at(1498099140 + Rational("1/3")).in_time_zone.inspect
240
- # => "Thu, 22 Jun 2017 02:39:00 UTC +00:00"
175
+ *Alex Robbin*, *Erich Soares Machado*, *Eugene Kenny*
241
176
 
242
- After:
177
+ * `ActiveSupport::Inflector::Inflections#clear(:acronyms)` is now supported,
178
+ and `inflector.clear` / `inflector.clear(:all)` also clears acronyms.
243
179
 
244
- Time.at(1498099140).in_time_zone.inspect
245
- # => "Thu, 22 Jun 2017 02:39:00.000000000 UTC +00:00"
246
- Time.at(1498099140, 123456780, :nsec).in_time_zone.inspect
247
- # => "Thu, 22 Jun 2017 02:39:00.123456780 UTC +00:00"
248
- Time.at(1498099140 + Rational("1/3")).in_time_zone.inspect
249
- # => "Thu, 22 Jun 2017 02:39:00.333333333 UTC +00:00"
180
+ *Alex Ghiculescu*, *Oliver Peate*
250
181
 
251
- *akinomaeni*
252
182
 
253
- * Calling `ActiveSupport::TaggedLogging#tagged` without a block now returns a tagged logger.
183
+ ## Rails 7.0.0.alpha2 (September 15, 2021) ##
254
184
 
255
- ```ruby
256
- logger.tagged("BCX").info("Funky time!") # => [BCX] Funky time!
257
- ```
258
-
259
- *Eugene Kenny*
185
+ * No changes.
260
186
 
261
- * Align `Range#cover?` extension behavior with Ruby behavior for backwards ranges.
262
187
 
263
- `(1..10).cover?(5..3)` now returns `false`, as it does in plain Ruby.
188
+ ## Rails 7.0.0.alpha1 (September 15, 2021) ##
264
189
 
265
- Also update `#include?` and `#===` behavior to match.
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.
266
191
 
267
- *Michael Groeneman*
192
+ *Xavier Noria*
268
193
 
269
- * Update to TZInfo v2.0.0.
194
+ * Private internal classes of `ActiveSupport::Dependencies` have been deleted, like `ActiveSupport::Dependencies::Reference`, `ActiveSupport::Dependencies::Blamable`, and others.
270
195
 
271
- This changes the output of `ActiveSupport::TimeZone.utc_to_local`, but
272
- can be controlled with the
273
- `ActiveSupport.utc_to_local_returns_utc_offset_times` config.
196
+ *Xavier Noria*
274
197
 
275
- New Rails 6.1 apps have it enabled by default, existing apps can upgrade
276
- via the config in config/initializers/new_framework_defaults_6_1.rb
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.
277
199
 
278
- See the `utc_to_local_returns_utc_offset_times` documentation for details.
200
+ *Xavier Noria*
279
201
 
280
- *Phil Ross*, *Jared Beck*
202
+ * Improves the performance of `ActiveSupport::NumberHelper` formatters by avoiding the use of exceptions as flow control.
281
203
 
282
- * Add Date and Time `#yesterday?` and `#tomorrow?` alongside `#today?`.
204
+ *Mike Dalessio*
283
205
 
284
- Aliased to `#prev_day?` and `#next_day?` to match the existing `#prev/next_day` methods.
206
+ * Removed rescue block from `ActiveSupport::Cache::RedisCacheStore#handle_exception`
285
207
 
286
- *Jatin Dhankhar*
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.
287
211
 
288
- * Add `Enumerable#pick` to complement `ActiveRecord::Relation#pick`.
212
+ *Nicholas A. Stuart*
289
213
 
290
- *Eugene Kenny*
214
+ * Allow entirely opting out of deprecation warnings.
291
215
 
292
- * [Breaking change] `ActiveSupport::Callbacks#halted_callback_hook` now receive a 2nd argument:
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.
293
219
 
294
- `ActiveSupport::Callbacks#halted_callback_hook` now receive the name of the callback
295
- being halted as second argument.
296
- This change will allow you to differentiate which callbacks halted the chain
297
- and act accordingly.
220
+ Now, you can make `ActiveSupport::Deprecation.warn` a no-op:
298
221
 
299
222
  ```ruby
300
- class Book < ApplicationRecord
301
- before_save { throw(:abort) }
302
- before_create { throw(:abort) }
223
+ config.active_support.report_deprecations = false
224
+ ```
303
225
 
304
- def halted_callback_hook(filter, callback_name)
305
- Rails.logger.info("Book couldn't be #{callback_name}d")
306
- end
226
+ This is the default in production for new apps. It is the equivalent to:
307
227
 
308
- Book.create # => "Book couldn't be created"
309
- book.save # => "Book couldn't be saved"
310
- end
228
+ ```ruby
229
+ config.active_support.deprecation = :silence
230
+ config.active_support.disallowed_deprecation = :silence
311
231
  ```
312
232
 
313
- *Edouard Chin*
233
+ but will take a more optimised code path.
234
+
235
+ *Alex Ghiculescu*
314
236
 
315
- * Support `prepend` with `ActiveSupport::Concern`.
237
+ * Faster tests by parallelizing only when overhead is justified by the number
238
+ of them.
316
239
 
317
- Allows a module with `extend ActiveSupport::Concern` to be prepended.
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.
318
243
 
319
- module Imposter
320
- extend ActiveSupport::Concern
244
+ This threshold is 50 by default, and is configurable via config setting in
245
+ your test.rb:
321
246
 
322
- # Same as `included`, except only run when prepended.
323
- prepended do
324
- end
325
- end
247
+ ```ruby
248
+ config.active_support.test_parallelization_threshold = 100
249
+ ```
326
250
 
327
- class Person
328
- prepend Imposter
329
- end
251
+ It's also configurable at the test case level:
330
252
 
331
- Class methods are prepended to the base class, concerning is also
332
- updated: `concerning :Imposter, prepend: true do`.
253
+ ```ruby
254
+ class ActiveSupport::TestCase
255
+ parallelize threshold: 100
256
+ end
257
+ ```
333
258
 
334
- *Jason Karns*, *Elia Schito*
259
+ *Jorge Manrubia*
335
260
 
336
- * Deprecate using `Range#include?` method to check the inclusion of a value
337
- in a date time range. It is recommended to use `Range#cover?` method
338
- instead of `Range#include?` to check the inclusion of a value
339
- in a date time range.
261
+ * OpenSSL constants are now used for Digest computations.
340
262
 
341
- *Vishal Telangre*
263
+ *Dirkjan Bussink*
342
264
 
343
- * Support added for a `round_mode` parameter, in all number helpers. (See: `BigDecimal::mode`.)
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`.
344
268
 
345
269
  ```ruby
346
- number_to_currency(1234567890.50, precision: 0, round_mode: :half_down) # => "$1,234,567,890"
347
- number_to_percentage(302.24398923423, precision: 5, round_mode: :down) # => "302.24398%"
348
- number_to_rounded(389.32314, precision: 0, round_mode: :ceil) # => "390"
349
- number_to_human_size(483989, precision: 2, round_mode: :up) # => "480 KB"
350
- number_to_human(489939, precision: 2, round_mode: :floor) # => "480 Thousand"
351
-
352
- 485000.to_s(:human, precision: 2, round_mode: :half_even) # => "480 Thousand"
270
+ twz = ActiveSupport::TimeZone["Eastern Time (US & Canada)"].iso8601("21087")
271
+ twz.to_a[0, 6] == [0, 0, 0, 28, 03, 2021]
353
272
  ```
354
273
 
355
- *Tom Lord*
274
+ *Steve Laing*
356
275
 
357
- * `Array#to_sentence` no longer returns a frozen string.
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.
358
279
 
359
- Before:
280
+ Fixes [#42467](https://github.com/rails/rails/issues/42467).
360
281
 
361
- ['one', 'two'].to_sentence.frozen?
362
- # => true
282
+ *Alex Ghiculescu*
363
283
 
364
- After:
284
+ * Allow serializing any module or class to JSON by name.
365
285
 
366
- ['one', 'two'].to_sentence.frozen?
367
- # => false
286
+ *Tyler Rick*, *Zachary Scott*
368
287
 
369
- *Nicolas Dular*
288
+ * Raise `ActiveSupport::EncryptedFile::MissingKeyError` when the
289
+ `RAILS_MASTER_KEY` environment variable is blank (e.g. `""`).
370
290
 
371
- * When an instance of `ActiveSupport::Duration` is converted to an `iso8601` duration string, if `weeks` are mixed with `date` parts, the `week` part will be converted to days.
372
- This keeps the parser and serializer on the same page.
291
+ *Sunny Ripert*
292
+
293
+ * The `from:` option is added to `ActiveSupport::TestCase#assert_no_changes`.
294
+
295
+ It permits asserting on the initial value that is expected not to change.
373
296
 
374
297
  ```ruby
375
- duration = ActiveSupport::Duration.build(1000000)
376
- # 1 week, 4 days, 13 hours, 46 minutes, and 40.0 seconds
298
+ assert_no_changes -> { Status.all_good? }, from: true do
299
+ post :create, params: { status: { ok: true } }
300
+ end
301
+ ```
377
302
 
378
- duration_iso = duration.iso8601
379
- # P11DT13H46M40S
303
+ *George Claghorn*
380
304
 
381
- ActiveSupport::Duration.parse(duration_iso)
382
- # 11 days, 13 hours, 46 minutes, and 40 seconds
305
+ * Deprecate `ActiveSupport::SafeBuffer`'s incorrect implicit conversion of objects into string.
383
306
 
384
- duration = ActiveSupport::Duration.build(604800)
385
- # 1 week
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.
386
312
 
387
- duration_iso = duration.iso8601
388
- # P1W
313
+ *Jean Boussier*
389
314
 
390
- ActiveSupport::Duration.parse(duration_iso)
391
- # 1 week
392
- ```
315
+ * Allow nested access to keys on `Rails.application.credentials`.
393
316
 
394
- *Abhishek Sarkar*
317
+ Previously only top level keys in `credentials.yml.enc` could be accessed with method calls. Now any key can.
395
318
 
396
- * Add block support to `ActiveSupport::Testing::TimeHelpers#travel_back`.
319
+ For example, given these secrets:
397
320
 
398
- *Tim Masliuchenko*
321
+ ```yml
322
+ aws:
323
+ access_key_id: 123
324
+ secret_access_key: 345
325
+ ```
399
326
 
400
- * Update `ActiveSupport::Messages::Metadata#fresh?` to work for cookies with expiry set when
401
- `ActiveSupport.parse_json_times = true`.
327
+ `Rails.application.credentials.aws.access_key_id` will now return the same thing as
328
+ `Rails.application.credentials.aws[:access_key_id]`.
402
329
 
403
- *Christian Gregg*
330
+ *Alex Ghiculescu*
404
331
 
405
- * Support symbolic links for `content_path` in `ActiveSupport::EncryptedFile`.
332
+ * Added a faster and more compact `ActiveSupport::Cache` serialization format.
406
333
 
407
- *Takumi Shotoku*
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.
408
339
 
409
- * Improve `Range#===`, `Range#include?`, and `Range#cover?` to work with beginless (startless)
410
- and endless range targets.
340
+ *Jean Boussier*
411
341
 
412
- *Allen Hsu*, *Andrew Hodgkinson*
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.
413
345
 
414
- * Don't use `Process#clock_gettime(CLOCK_THREAD_CPUTIME_ID)` on Solaris.
346
+ *Asherah Connor*
415
347
 
416
- *Iain Beeston*
348
+ * Freeze `ActiveSupport::Duration#parts` and remove writer methods.
417
349
 
418
- * Prevent `ActiveSupport::Duration.build(value)` from creating instances of
419
- `ActiveSupport::Duration` unless `value` is of type `Numeric`.
350
+ Durations are meant to be value objects and should not be mutated.
420
351
 
421
- Addresses the errant set of behaviours described in #37012 where
422
- `ActiveSupport::Duration` comparisons would fail confusingly
423
- or return unexpected results when comparing durations built from instances of `String`.
352
+ *Andrew White*
424
353
 
425
- Before:
354
+ * Fix `ActiveSupport::TimeZone#utc_to_local` with fractional seconds.
426
355
 
427
- small_duration_from_string = ActiveSupport::Duration.build('9')
428
- large_duration_from_string = ActiveSupport::Duration.build('100000000000000')
429
- small_duration_from_int = ActiveSupport::Duration.build(9)
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.
430
360
 
431
- large_duration_from_string > small_duration_from_string
432
- # => false
361
+ *Andrew White*
433
362
 
434
- small_duration_from_string == small_duration_from_int
435
- # => false
363
+ * Add `expires_at` argument to `ActiveSupport::Cache` `write` and `fetch` to set a cache entry TTL as an absolute time.
436
364
 
437
- small_duration_from_int < large_duration_from_string
438
- # => ArgumentError (comparison of ActiveSupport::Duration::Scalar with ActiveSupport::Duration failed)
365
+ ```ruby
366
+ Rails.cache.write(key, value, expires_at: Time.now.at_end_of_hour)
367
+ ```
439
368
 
440
- large_duration_from_string > small_duration_from_int
441
- # => ArgumentError (comparison of String with ActiveSupport::Duration failed)
369
+ *Jean Boussier*
442
370
 
443
- After:
371
+ * Deprecate `ActiveSupport::TimeWithZone.name` so that from Rails 7.1 it will use the default implementation.
444
372
 
445
- small_duration_from_string = ActiveSupport::Duration.build('9')
446
- # => TypeError (can't build an ActiveSupport::Duration from a String)
373
+ *Andrew White*
447
374
 
448
- *Alexei Emam*
375
+ * Deprecates Rails custom `Enumerable#sum` and `Array#sum` in favor of Ruby's native implementation which
376
+ is considerably faster.
449
377
 
450
- * Add `ActiveSupport::Cache::Store#delete_multi` method to delete multiple keys from the cache store.
378
+ Ruby requires an initializer for non-numeric type as per examples below:
451
379
 
452
- *Peter Zhu*
380
+ ```ruby
381
+ %w[foo bar].sum('')
382
+ # instead of %w[foo bar].sum
453
383
 
454
- * Support multiple arguments in `HashWithIndifferentAccess` for `merge` and `update` methods, to
455
- follow Ruby 2.6 addition.
384
+ [[1, 2], [3, 4, 5]].sum([])
385
+ # instead of [[1, 2], [3, 4, 5]].sum
386
+ ```
456
387
 
457
- *Wojciech Wnętrzak*
388
+ *Alberto Mota*
458
389
 
459
- * Allow initializing `thread_mattr_*` attributes via `:default` option.
390
+ * Tests parallelization is now disabled when running individual files to prevent the setup overhead.
460
391
 
461
- class Scraper
462
- thread_mattr_reader :client, default: Api::Client.new
463
- end
392
+ It can still be enforced if the environment variable `PARALLEL_WORKERS` is present and set to a value greater than 1.
464
393
 
465
- *Guilherme Mansur*
394
+ *Ricardo Díaz*
466
395
 
467
- * Add `compact_blank` for those times when you want to remove #blank? values from
468
- an Enumerable (also `compact_blank!` on Hash, Array, ActionController::Parameters).
396
+ * Fix proxying keyword arguments in `ActiveSupport::CurrentAttributes`.
469
397
 
470
- *Dana Sherson*
398
+ *Marcin Kołodziej*
471
399
 
472
- * Make ActiveSupport::Logger Fiber-safe.
400
+ * Add `Enumerable#maximum` and `Enumerable#minimum` to easily calculate the maximum or minimum from extracted
401
+ elements of an enumerable.
473
402
 
474
- Use `Fiber.current.__id__` in `ActiveSupport::Logger#local_level=` in order
475
- to make log level local to Ruby Fibers in addition to Threads.
403
+ ```ruby
404
+ payments = [Payment.new(5), Payment.new(15), Payment.new(10)]
476
405
 
477
- Example:
406
+ payments.minimum(:price) # => 5
407
+ payments.maximum(:price) # => 15
408
+ ```
478
409
 
479
- logger = ActiveSupport::Logger.new(STDOUT)
480
- logger.level = 1
481
- puts "Main is debug? #{logger.debug?}"
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.
482
412
 
483
- Fiber.new {
484
- logger.local_level = 0
485
- puts "Thread is debug? #{logger.debug?}"
486
- }.resume
413
+ *Ayrton De Craene*
487
414
 
488
- puts "Main is debug? #{logger.debug?}"
415
+ * `ActiveSupport::Cache::MemCacheStore` now accepts an explicit `nil` for its `addresses` argument.
489
416
 
490
- Before:
417
+ ```ruby
418
+ config.cache_store = :mem_cache_store, nil
491
419
 
492
- Main is debug? false
493
- Thread is debug? true
494
- Main is debug? true
420
+ # is now equivalent to
495
421
 
496
- After:
422
+ config.cache_store = :mem_cache_store
497
423
 
498
- Main is debug? false
499
- Thread is debug? true
500
- Main is debug? false
424
+ # and is also equivalent to
501
425
 
502
- Fixes #36752.
426
+ config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211"
503
427
 
504
- *Alexander Varnin*
428
+ # which is the fallback behavior of Dalli
429
+ ```
505
430
 
506
- * Allow the `on_rotation` proc used when decrypting/verifying a message to be
507
- passed at the constructor level.
431
+ This helps those migrating from `:dalli_store`, where an explicit `nil` was permitted.
508
432
 
509
- Before:
433
+ *Michael Overmeyer*
510
434
 
511
- crypt = ActiveSupport::MessageEncryptor.new('long_secret')
512
- crypt.decrypt_and_verify(encrypted_message, on_rotation: proc { ... })
513
- crypt.decrypt_and_verify(another_encrypted_message, on_rotation: proc { ... })
435
+ * Add `Enumerable#in_order_of` to put an Enumerable in a certain order by a key.
514
436
 
515
- After:
437
+ *DHH*
516
438
 
517
- crypt = ActiveSupport::MessageEncryptor.new('long_secret', on_rotation: proc { ... })
518
- crypt.decrypt_and_verify(encrypted_message)
519
- crypt.decrypt_and_verify(another_encrypted_message)
439
+ * `ActiveSupport::Inflector.camelize` behaves expected when provided a symbol `:upper` or `:lower` argument. Matches
440
+ `String#camelize` behavior.
520
441
 
521
- *Edouard Chin*
442
+ *Alex Ghiculescu*
522
443
 
523
- * `delegate_missing_to` would raise a `DelegationError` if the object
524
- delegated to was `nil`. Now the `allow_nil` option has been added to enable
525
- the user to specify they want `nil` returned in this case.
444
+ * Raises an `ArgumentError` when the first argument of `ActiveSupport::Notification.subscribe` is
445
+ invalid.
526
446
 
527
- *Matthew Tanous*
447
+ *Vipul A M*
528
448
 
529
- * `truncate` would return the original string if it was too short to be truncated
530
- and a frozen string if it were long enough to be truncated. Now truncate will
531
- consistently return an unfrozen string regardless. This behavior is consistent
532
- with `gsub` and `strip`.
449
+ * `HashWithIndifferentAccess#deep_transform_keys` now returns a `HashWithIndifferentAccess` instead of a `Hash`.
533
450
 
534
- Before:
451
+ *Nathaniel Woodthorpe*
535
452
 
536
- 'foobar'.truncate(5).frozen?
537
- # => true
538
- 'foobar'.truncate(6).frozen?
539
- # => false
453
+ * Consume dalli’s `cache_nils` configuration as `ActiveSupport::Cache`'s `skip_nil` when using `MemCacheStore`.
540
454
 
541
- After:
455
+ *Ritikesh G*
542
456
 
543
- 'foobar'.truncate(5).frozen?
544
- # => false
545
- 'foobar'.truncate(6).frozen?
546
- # => false
457
+ * Add `RedisCacheStore#stats` method similar to `MemCacheStore#stats`. Calls `redis#info` internally.
547
458
 
548
- *Jordan Thomas*
459
+ *Ritikesh G*
549
460
 
550
461
 
551
- Please check [6-0-stable](https://github.com/rails/rails/blob/6-0-stable/activesupport/CHANGELOG.md) for previous changes.
462
+ Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/activesupport/CHANGELOG.md) for previous changes.