activesupport 6.1.7.2 → 7.0.7

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