activesupport 7.0.8.6 → 7.2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +143 -454
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +4 -4
  5. data/lib/active_support/actionable_error.rb +3 -1
  6. data/lib/active_support/array_inquirer.rb +3 -1
  7. data/lib/active_support/backtrace_cleaner.rb +39 -7
  8. data/lib/active_support/benchmarkable.rb +1 -0
  9. data/lib/active_support/broadcast_logger.rb +251 -0
  10. data/lib/active_support/builder.rb +1 -1
  11. data/lib/active_support/cache/coder.rb +153 -0
  12. data/lib/active_support/cache/entry.rb +134 -0
  13. data/lib/active_support/cache/file_store.rb +49 -17
  14. data/lib/active_support/cache/mem_cache_store.rb +94 -128
  15. data/lib/active_support/cache/memory_store.rb +80 -25
  16. data/lib/active_support/cache/null_store.rb +6 -0
  17. data/lib/active_support/cache/redis_cache_store.rb +165 -152
  18. data/lib/active_support/cache/serializer_with_fallback.rb +152 -0
  19. data/lib/active_support/cache/strategy/local_cache.rb +29 -14
  20. data/lib/active_support/cache.rb +363 -291
  21. data/lib/active_support/callbacks.rb +118 -134
  22. data/lib/active_support/code_generator.rb +15 -10
  23. data/lib/active_support/concern.rb +4 -2
  24. data/lib/active_support/concurrency/load_interlock_aware_monitor.rb +42 -3
  25. data/lib/active_support/concurrency/null_lock.rb +13 -0
  26. data/lib/active_support/configurable.rb +10 -0
  27. data/lib/active_support/core_ext/array/conversions.rb +1 -2
  28. data/lib/active_support/core_ext/array.rb +0 -1
  29. data/lib/active_support/core_ext/class/subclasses.rb +17 -34
  30. data/lib/active_support/core_ext/date/blank.rb +4 -0
  31. data/lib/active_support/core_ext/date/conversions.rb +1 -2
  32. data/lib/active_support/core_ext/date.rb +0 -1
  33. data/lib/active_support/core_ext/date_and_time/calculations.rb +10 -0
  34. data/lib/active_support/core_ext/date_and_time/compatibility.rb +28 -1
  35. data/lib/active_support/core_ext/date_time/blank.rb +4 -0
  36. data/lib/active_support/core_ext/date_time/conversions.rb +2 -2
  37. data/lib/active_support/core_ext/date_time.rb +0 -1
  38. data/lib/active_support/core_ext/digest/uuid.rb +7 -10
  39. data/lib/active_support/core_ext/enumerable.rb +3 -75
  40. data/lib/active_support/core_ext/erb/util.rb +201 -0
  41. data/lib/active_support/core_ext/hash/conversions.rb +1 -1
  42. data/lib/active_support/core_ext/hash/deep_merge.rb +22 -14
  43. data/lib/active_support/core_ext/hash/keys.rb +4 -4
  44. data/lib/active_support/core_ext/module/attr_internal.rb +17 -6
  45. data/lib/active_support/core_ext/module/attribute_accessors.rb +6 -0
  46. data/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb +34 -16
  47. data/lib/active_support/core_ext/module/concerning.rb +6 -6
  48. data/lib/active_support/core_ext/module/delegation.rb +20 -119
  49. data/lib/active_support/core_ext/module/deprecation.rb +12 -12
  50. data/lib/active_support/core_ext/module/introspection.rb +0 -1
  51. data/lib/active_support/core_ext/numeric/bytes.rb +9 -0
  52. data/lib/active_support/core_ext/numeric/conversions.rb +5 -3
  53. data/lib/active_support/core_ext/numeric.rb +0 -1
  54. data/lib/active_support/core_ext/object/blank.rb +45 -1
  55. data/lib/active_support/core_ext/object/deep_dup.rb +16 -0
  56. data/lib/active_support/core_ext/object/inclusion.rb +13 -5
  57. data/lib/active_support/core_ext/object/instance_variables.rb +4 -2
  58. data/lib/active_support/core_ext/object/json.rb +17 -7
  59. data/lib/active_support/core_ext/object/with.rb +46 -0
  60. data/lib/active_support/core_ext/object/with_options.rb +4 -4
  61. data/lib/active_support/core_ext/object.rb +1 -0
  62. data/lib/active_support/core_ext/pathname/blank.rb +20 -0
  63. data/lib/active_support/core_ext/pathname/existence.rb +2 -0
  64. data/lib/active_support/core_ext/pathname.rb +1 -0
  65. data/lib/active_support/core_ext/range/conversions.rb +28 -7
  66. data/lib/active_support/core_ext/range/overlap.rb +40 -0
  67. data/lib/active_support/core_ext/range.rb +1 -2
  68. data/lib/active_support/core_ext/securerandom.rb +1 -5
  69. data/lib/active_support/core_ext/string/conversions.rb +1 -1
  70. data/lib/active_support/core_ext/string/filters.rb +21 -15
  71. data/lib/active_support/core_ext/string/indent.rb +1 -1
  72. data/lib/active_support/core_ext/string/inflections.rb +16 -5
  73. data/lib/active_support/core_ext/string/multibyte.rb +1 -1
  74. data/lib/active_support/core_ext/string/output_safety.rb +34 -177
  75. data/lib/active_support/core_ext/thread/backtrace/location.rb +12 -0
  76. data/lib/active_support/core_ext/time/calculations.rb +36 -30
  77. data/lib/active_support/core_ext/time/compatibility.rb +16 -0
  78. data/lib/active_support/core_ext/time/conversions.rb +1 -3
  79. data/lib/active_support/core_ext/time/zones.rb +4 -4
  80. data/lib/active_support/core_ext/time.rb +0 -1
  81. data/lib/active_support/core_ext.rb +0 -1
  82. data/lib/active_support/current_attributes.rb +53 -46
  83. data/lib/active_support/deep_mergeable.rb +53 -0
  84. data/lib/active_support/delegation.rb +202 -0
  85. data/lib/active_support/dependencies/autoload.rb +9 -16
  86. data/lib/active_support/deprecation/behaviors.rb +65 -42
  87. data/lib/active_support/deprecation/constant_accessor.rb +47 -25
  88. data/lib/active_support/deprecation/deprecators.rb +104 -0
  89. data/lib/active_support/deprecation/disallowed.rb +3 -5
  90. data/lib/active_support/deprecation/method_wrappers.rb +6 -23
  91. data/lib/active_support/deprecation/proxy_wrappers.rb +34 -22
  92. data/lib/active_support/deprecation/reporting.rb +49 -27
  93. data/lib/active_support/deprecation.rb +39 -9
  94. data/lib/active_support/deprecator.rb +7 -0
  95. data/lib/active_support/descendants_tracker.rb +66 -172
  96. data/lib/active_support/duration/iso8601_parser.rb +2 -2
  97. data/lib/active_support/duration/iso8601_serializer.rb +1 -4
  98. data/lib/active_support/duration.rb +13 -7
  99. data/lib/active_support/encrypted_configuration.rb +30 -9
  100. data/lib/active_support/encrypted_file.rb +9 -4
  101. data/lib/active_support/environment_inquirer.rb +22 -2
  102. data/lib/active_support/error_reporter/test_helper.rb +15 -0
  103. data/lib/active_support/error_reporter.rb +160 -36
  104. data/lib/active_support/evented_file_update_checker.rb +0 -1
  105. data/lib/active_support/execution_wrapper.rb +4 -5
  106. data/lib/active_support/file_update_checker.rb +5 -3
  107. data/lib/active_support/fork_tracker.rb +4 -32
  108. data/lib/active_support/gem_version.rb +4 -4
  109. data/lib/active_support/gzip.rb +2 -0
  110. data/lib/active_support/hash_with_indifferent_access.rb +41 -25
  111. data/lib/active_support/html_safe_translation.rb +19 -6
  112. data/lib/active_support/i18n.rb +1 -1
  113. data/lib/active_support/i18n_railtie.rb +20 -13
  114. data/lib/active_support/inflector/inflections.rb +2 -0
  115. data/lib/active_support/inflector/methods.rb +23 -11
  116. data/lib/active_support/inflector/transliterate.rb +3 -1
  117. data/lib/active_support/isolated_execution_state.rb +26 -22
  118. data/lib/active_support/json/decoding.rb +2 -1
  119. data/lib/active_support/json/encoding.rb +25 -43
  120. data/lib/active_support/key_generator.rb +9 -1
  121. data/lib/active_support/lazy_load_hooks.rb +6 -4
  122. data/lib/active_support/locale/en.yml +2 -0
  123. data/lib/active_support/log_subscriber.rb +74 -34
  124. data/lib/active_support/logger.rb +22 -60
  125. data/lib/active_support/logger_thread_safe_level.rb +10 -32
  126. data/lib/active_support/message_encryptor.rb +197 -53
  127. data/lib/active_support/message_encryptors.rb +141 -0
  128. data/lib/active_support/message_pack/cache_serializer.rb +23 -0
  129. data/lib/active_support/message_pack/extensions.rb +305 -0
  130. data/lib/active_support/message_pack/serializer.rb +63 -0
  131. data/lib/active_support/message_pack.rb +50 -0
  132. data/lib/active_support/message_verifier.rb +220 -89
  133. data/lib/active_support/message_verifiers.rb +135 -0
  134. data/lib/active_support/messages/codec.rb +65 -0
  135. data/lib/active_support/messages/metadata.rb +111 -45
  136. data/lib/active_support/messages/rotation_coordinator.rb +93 -0
  137. data/lib/active_support/messages/rotator.rb +34 -32
  138. data/lib/active_support/messages/serializer_with_fallback.rb +158 -0
  139. data/lib/active_support/multibyte/chars.rb +4 -2
  140. data/lib/active_support/multibyte/unicode.rb +9 -37
  141. data/lib/active_support/notifications/fanout.rb +248 -87
  142. data/lib/active_support/notifications/instrumenter.rb +93 -25
  143. data/lib/active_support/notifications.rb +29 -28
  144. data/lib/active_support/number_helper/number_converter.rb +16 -7
  145. data/lib/active_support/number_helper/number_to_currency_converter.rb +6 -6
  146. data/lib/active_support/number_helper/number_to_human_size_converter.rb +3 -3
  147. data/lib/active_support/number_helper/number_to_phone_converter.rb +1 -0
  148. data/lib/active_support/number_helper.rb +379 -318
  149. data/lib/active_support/option_merger.rb +2 -2
  150. data/lib/active_support/ordered_hash.rb +3 -3
  151. data/lib/active_support/ordered_options.rb +67 -15
  152. data/lib/active_support/parameter_filter.rb +84 -69
  153. data/lib/active_support/proxy_object.rb +8 -3
  154. data/lib/active_support/railtie.rb +25 -20
  155. data/lib/active_support/reloader.rb +12 -4
  156. data/lib/active_support/rescuable.rb +2 -0
  157. data/lib/active_support/secure_compare_rotator.rb +16 -9
  158. data/lib/active_support/string_inquirer.rb +4 -2
  159. data/lib/active_support/subscriber.rb +10 -27
  160. data/lib/active_support/syntax_error_proxy.rb +60 -0
  161. data/lib/active_support/tagged_logging.rb +64 -25
  162. data/lib/active_support/test_case.rb +156 -7
  163. data/lib/active_support/testing/assertions.rb +28 -12
  164. data/lib/active_support/testing/autorun.rb +0 -2
  165. data/lib/active_support/testing/constant_stubbing.rb +54 -0
  166. data/lib/active_support/testing/deprecation.rb +20 -27
  167. data/lib/active_support/testing/error_reporter_assertions.rb +107 -0
  168. data/lib/active_support/testing/isolation.rb +21 -9
  169. data/lib/active_support/testing/method_call_assertions.rb +7 -8
  170. data/lib/active_support/testing/parallelization/server.rb +3 -0
  171. data/lib/active_support/testing/parallelize_executor.rb +8 -3
  172. data/lib/active_support/testing/setup_and_teardown.rb +2 -0
  173. data/lib/active_support/testing/stream.rb +1 -1
  174. data/lib/active_support/testing/strict_warnings.rb +43 -0
  175. data/lib/active_support/testing/tests_without_assertions.rb +19 -0
  176. data/lib/active_support/testing/time_helpers.rb +38 -16
  177. data/lib/active_support/time_with_zone.rb +12 -18
  178. data/lib/active_support/values/time_zone.rb +25 -14
  179. data/lib/active_support/version.rb +1 -1
  180. data/lib/active_support/xml_mini/jdom.rb +3 -10
  181. data/lib/active_support/xml_mini/nokogiri.rb +1 -1
  182. data/lib/active_support/xml_mini/nokogirisax.rb +1 -1
  183. data/lib/active_support/xml_mini/rexml.rb +1 -1
  184. data/lib/active_support/xml_mini.rb +12 -3
  185. data/lib/active_support.rb +15 -3
  186. metadata +142 -21
  187. data/lib/active_support/core_ext/array/deprecated_conversions.rb +0 -25
  188. data/lib/active_support/core_ext/date/deprecated_conversions.rb +0 -40
  189. data/lib/active_support/core_ext/date_time/deprecated_conversions.rb +0 -36
  190. data/lib/active_support/core_ext/numeric/deprecated_conversions.rb +0 -60
  191. data/lib/active_support/core_ext/range/deprecated_conversions.rb +0 -36
  192. data/lib/active_support/core_ext/range/include_time_with_zone.rb +0 -5
  193. data/lib/active_support/core_ext/range/overlaps.rb +0 -10
  194. data/lib/active_support/core_ext/time/deprecated_conversions.rb +0 -73
  195. data/lib/active_support/core_ext/uri.rb +0 -5
  196. data/lib/active_support/deprecation/instance_delegator.rb +0 -38
  197. data/lib/active_support/per_thread_registry.rb +0 -65
  198. data/lib/active_support/ruby_features.rb +0 -7
data/CHANGELOG.md CHANGED
@@ -1,595 +1,284 @@
1
- ## Rails 7.0.8.6 (October 23, 2024) ##
1
+ ## Rails 7.2.2.1 (December 10, 2024) ##
2
2
 
3
3
  * No changes.
4
4
 
5
5
 
6
- ## Rails 7.0.8.5 (October 15, 2024) ##
6
+ ## Rails 7.2.2 (October 30, 2024) ##
7
7
 
8
- * No changes.
8
+ * Include options when instrumenting `ActiveSupport::Cache::Store#delete` and `ActiveSupport::Cache::Store#delete_multi`.
9
9
 
10
+ *Adam Renberg Tamm*
10
11
 
11
- ## Rails 7.0.8.4 (June 04, 2024) ##
12
+ * Print test names when running `rails test -v` for parallel tests.
12
13
 
13
- * No changes.
14
+ *John Hawthorn*, *Abeid Ahmed*
14
15
 
15
16
 
16
- ## Rails 7.0.8.3 (May 17, 2024) ##
17
+ ## Rails 7.2.1.2 (October 23, 2024) ##
17
18
 
18
19
  * No changes.
19
20
 
20
21
 
21
- ## Rails 7.0.8.2 (May 16, 2024) ##
22
+ ## Rails 7.2.1.1 (October 15, 2024) ##
22
23
 
23
24
  * No changes.
24
25
 
25
26
 
26
- ## Rails 7.0.8.1 (February 21, 2024) ##
27
-
28
- * No changes.
29
-
30
-
31
- ## Rails 7.0.8 (September 09, 2023) ##
32
-
33
- * Fix `TimeWithZone` still using deprecated `#to_s` when `ENV` or `config` to
34
- disable it are set.
35
-
36
- *Hartley McGuire*
37
-
38
- * Fix CacheStore#write_multi when using a distributed Redis cache with a connection pool.
39
-
40
- Fixes [#48938](https://github.com/rails/rails/issues/48938).
41
-
42
- *Jonathan del Strother*
43
-
44
-
45
- ## Rails 7.0.7.2 (August 22, 2023) ##
27
+ ## Rails 7.2.1 (August 22, 2024) ##
46
28
 
47
29
  * No changes.
48
30
 
49
31
 
50
- ## Rails 7.0.7.1 (August 22, 2023) ##
51
-
52
- * Use a temporary file for storing unencrypted files while editing
53
-
54
- [CVE-2023-38037]
55
-
56
-
57
- ## Rails 7.0.7 (August 09, 2023) ##
58
-
59
- * Fix `Cache::NullStore` with local caching for repeated reads.
60
-
61
- *fatkodima*
62
-
63
- * Fix `to_s` with no arguments not respecting custom `:default` formats
64
-
65
- *Hartley McGuire*
66
-
67
- * Fix `ActiveSupport::Inflector.humanize(nil)` raising ``NoMethodError: undefined method `end_with?' for nil:NilClass``.
68
-
69
- *James Robinson*
70
-
71
- * Fix `Enumerable#sum` for `Enumerator#lazy`.
72
-
73
- *fatkodima*, *Matthew Draper*, *Jonathan Hefner*
74
-
75
- * Improve error message when EventedFileUpdateChecker is used without a
76
- compatible version of the Listen gem
77
-
78
- *Hartley McGuire*
79
-
80
-
81
- ## Rails 7.0.6 (June 29, 2023) ##
82
-
83
- * Fix `EncryptedConfiguration` returning incorrect values for some `Hash`
84
- methods
85
-
86
- *Hartley McGuire*
87
-
88
- * Fix arguments being destructed `Enumerable#many?` with block.
89
-
90
- *Andrew Novoselac*
91
-
92
- * Fix humanize for strings ending with id.
93
-
94
- *fatkodima*
95
-
96
-
97
- ## Rails 7.0.5.1 (June 26, 2023) ##
98
-
99
- * No changes.
100
-
101
-
102
- ## Rails 7.0.5 (May 24, 2023) ##
103
-
104
- * Fixes TimeWithZone ArgumentError.
105
-
106
- *Niklas Häusele*
107
-
108
-
109
- ## Rails 7.0.4.3 (March 13, 2023) ##
110
-
111
- * Implement SafeBuffer#bytesplice
32
+ ## Rails 7.2.0 (August 09, 2024) ##
112
33
 
113
- [CVE-2023-28120]
34
+ * Fix `delegate_missing_to allow_nil: true` when called with implict self
114
35
 
36
+ ```ruby
37
+ class Person
38
+ delegate_missing_to :address, allow_nil: true
115
39
 
116
- ## Rails 7.0.4.2 (January 24, 2023) ##
117
-
118
- * No changes.
119
-
120
-
121
- ## Rails 7.0.4.1 (January 17, 2023) ##
122
-
123
- * Avoid regex backtracking in Inflector.underscore
124
-
125
- [CVE-2023-22796]
126
-
127
-
128
- ## Rails 7.0.4 (September 09, 2022) ##
129
-
130
- * Ensure `ActiveSupport::Testing::Isolation::Forking` closes pipes
131
-
132
- Previously, `Forking.run_in_isolation` opened two ends of a pipe. The fork
133
- process closed the read end, wrote to it, and then terminated (which
134
- presumably closed the file descriptors on its end). The parent process
135
- closed the write end, read from it, and returned, never closing the read
136
- end.
137
-
138
- This resulted in an accumulation of open file descriptors, which could
139
- cause errors if the limit is reached.
40
+ def address
41
+ nil
42
+ end
140
43
 
141
- *Sam Bostock*
44
+ def berliner?
45
+ city == "Berlin"
46
+ end
47
+ end
142
48
 
143
- * Redis cache store is now compatible with redis-rb 5.0.
49
+ Person.new.city # => nil
50
+ Person.new.berliner? # undefined local variable or method `city' for an instance of Person (NameError)
51
+ ```
144
52
 
145
53
  *Jean Boussier*
146
54
 
147
- * Fix `NoMethodError` on custom `ActiveSupport::Deprecation` behavior.
148
-
149
- `ActiveSupport::Deprecation.behavior=` was supposed to accept any object
150
- that responds to `call`, but in fact its internal implementation assumed that
151
- this object could respond to `arity`, so it was restricted to only `Proc` objects.
152
-
153
- This change removes this `arity` restriction of custom behaviors.
154
-
155
- *Ryo Nakamura*
156
-
157
-
158
- ## Rails 7.0.3.1 (July 12, 2022) ##
159
-
160
- * No changes.
161
-
162
-
163
- ## Rails 7.0.3 (May 09, 2022) ##
164
-
165
- * No changes.
166
-
55
+ * Add `logger` as a dependency since it is a bundled gem candidate for Ruby 3.5
167
56
 
168
- ## Rails 7.0.2.4 (April 26, 2022) ##
57
+ *Earlopain*
169
58
 
170
- * Fix and add protections for XSS in `ActionView::Helpers` and `ERB::Util`.
59
+ * Define `Digest::UUID.nil_uuid`, which returns the so-called nil UUID.
171
60
 
172
- Add the method `ERB::Util.xml_name_escape` to escape dangerous characters
173
- in names of tags and names of attributes, following the specification of XML.
174
-
175
- *Álvaro Martín Fraguas*
176
-
177
- ## Rails 7.0.2.3 (March 08, 2022) ##
178
-
179
- * No changes.
180
-
181
-
182
- ## Rails 7.0.2.2 (February 11, 2022) ##
183
-
184
- * Fix Reloader method signature to work with the new Executor signature
185
-
186
-
187
- ## Rails 7.0.2.1 (February 11, 2022) ##
188
-
189
- * No changes.
190
-
191
-
192
- ## Rails 7.0.2 (February 08, 2022) ##
193
-
194
- * Fix `ActiveSupport::EncryptedConfiguration` to be compatible with Psych 4
195
-
196
- *Stephen Sugden*
197
-
198
- * Improve `File.atomic_write` error handling.
199
-
200
- *Daniel Pepper*
201
-
202
-
203
- ## Rails 7.0.1 (January 06, 2022) ##
204
-
205
- * Fix `Class#descendants` and `DescendantsTracker#descendants` compatibility with Ruby 3.1.
206
-
207
- [The native `Class#descendants` was reverted prior to Ruby 3.1 release](https://bugs.ruby-lang.org/issues/14394#note-33),
208
- but `Class#subclasses` was kept, breaking the feature detection.
61
+ *Xavier Noria*
209
62
 
210
- *Jean Boussier*
63
+ * Support `duration` type in `ActiveSupport::XmlMini`.
211
64
 
65
+ *heka1024*
212
66
 
213
- ## Rails 7.0.0 (December 15, 2021) ##
67
+ * Remove deprecated `ActiveSupport::Notifications::Event#children` and `ActiveSupport::Notifications::Event#parent_of?`.
214
68
 
215
- * Fix `ActiveSupport::Duration.build` to support negative values.
69
+ *Rafael Mendonça França*
216
70
 
217
- The algorithm to collect the `parts` of the `ActiveSupport::Duration`
218
- ignored the sign of the `value` and accumulated incorrect part values. This
219
- impacted `ActiveSupport::Duration#sum` (which is dependent on `parts`) but
220
- not `ActiveSupport::Duration#eql?` (which is dependent on `value`).
71
+ * Remove deprecated support to call the following methods without passing a deprecator:
221
72
 
222
- *Caleb Buxton*, *Braden Staudacher*
73
+ - `deprecate`
74
+ - `deprecate_constant`
75
+ - `ActiveSupport::Deprecation::DeprecatedObjectProxy.new`
76
+ - `ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.new`
77
+ - `ActiveSupport::Deprecation::DeprecatedConstantProxy.new`
78
+ - `assert_deprecated`
79
+ - `assert_not_deprecated`
80
+ - `collect_deprecations`
223
81
 
82
+ *Rafael Mendonça França*
224
83
 
225
- ## Rails 7.0.0.rc3 (December 14, 2021) ##
84
+ * Remove deprecated `ActiveSupport::Deprecation` delegation to instance.
226
85
 
227
- * No changes.
86
+ *Rafael Mendonça França*
228
87
 
88
+ * Remove deprecated `SafeBuffer#clone_empty`.
229
89
 
230
- ## Rails 7.0.0.rc2 (December 14, 2021) ##
90
+ *Rafael Mendonça França*
231
91
 
232
- * No changes.
92
+ * Remove deprecated `#to_default_s` from `Array`, `Date`, `DateTime` and `Time`.
233
93
 
234
- ## Rails 7.0.0.rc1 (December 06, 2021) ##
94
+ *Rafael Mendonça França*
235
95
 
236
- * Deprecate passing a format to `#to_s` in favor of `#to_formatted_s` in `Array`, `Range`, `Date`, `DateTime`, `Time`,
237
- `BigDecimal`, `Float` and, `Integer`.
96
+ * Remove deprecated support to passing `Dalli::Client` instances to `MemCacheStore`.
238
97
 
239
98
  *Rafael Mendonça França*
240
99
 
241
- * Document `ActiveSupport::Testing::Deprecation`.
100
+ * Remove deprecated `config.active_support.use_rfc4122_namespaced_uuids`.
242
101
 
243
- *Sam Bostock & Sam Jordan*
102
+ *Rafael Mendonça França*
244
103
 
245
- * Add `Pathname#existence`.
104
+ * Remove deprecated `config.active_support.remove_deprecated_time_with_zone_name`.
246
105
 
247
- ```ruby
248
- Pathname.new("file").existence&.read
249
- ```
250
-
251
- *Timo Schilling*
106
+ *Rafael Mendonça França*
252
107
 
253
- * Remove deprecate `ActiveSupport::Multibyte::Unicode.default_normalization_form`.
108
+ * Remove deprecated `config.active_support.disable_to_s_conversion`.
254
109
 
255
110
  *Rafael Mendonça França*
256
111
 
257
- * Remove deprecated support to use `Range#include?` to check the inclusion of a value in
258
- a date time range is deprecated.
112
+ * Remove deprecated support to bolding log text with positional boolean in `ActiveSupport::LogSubscriber#color`.
259
113
 
260
114
  *Rafael Mendonça França*
261
115
 
262
- * Remove deprecated `URI.parser`.
116
+ * Remove deprecated constants `ActiveSupport::LogSubscriber::CLEAR` and `ActiveSupport::LogSubscriber::BOLD`.
263
117
 
264
118
  *Rafael Mendonça França*
265
119
 
266
- * Remove deprecated `config.active_support.use_sha1_digests`.
120
+ * Remove deprecated support for `config.active_support.cache_format_version = 6.1`.
267
121
 
268
122
  *Rafael Mendonça França*
269
123
 
270
- * Invoking `Object#with_options` without a `&block` argument returns the
271
- `ActiveSupport::OptionMerger` instance.
272
-
273
- *Sean Doyle*
124
+ * Remove deprecated `:pool_size` and `:pool_timeout` options for the cache storage.
274
125
 
275
- * `Rails.application.executor` hooks can now be called around every test
126
+ *Rafael Mendonça França*
276
127
 
277
- This helps to better simulate request or job local state being reset around tests and prevents state
278
- leaking from one test to another.
128
+ * Warn on tests without assertions.
279
129
 
280
- However it requires the executor hooks executed in the test environment to be re-entrant.
130
+ `ActiveSupport::TestCase` now warns when tests do not run any assertions.
131
+ This is helpful in detecting broken tests that do not perform intended assertions.
281
132
 
282
- To enable this, set `config.active_support.executor_around_test_case = true` (this is the default in Rails 7).
133
+ *fatkodima*
283
134
 
284
- *Jean Boussier*
135
+ * Support `hexBinary` type in `ActiveSupport::XmlMini`.
285
136
 
286
- * `ActiveSupport::DescendantsTracker` now mostly delegate to `Class#descendants` on Ruby 3.1
137
+ *heka1024*
287
138
 
288
- Ruby now provides a fast `Class#descendants` making `ActiveSupport::DescendantsTracker` mostly useless.
139
+ * Deprecate `ActiveSupport::ProxyObject` in favor of Ruby's built-in `BasicObject`.
289
140
 
290
- As a result the following methods are deprecated:
141
+ *Earlopain*
291
142
 
292
- - `ActiveSupport::DescendantsTracker.direct_descendants`
293
- - `ActiveSupport::DescendantsTracker#direct_descendants`
143
+ * `stub_const` now accepts a `exists: false` parameter to allow stubbing missing constants.
294
144
 
295
145
  *Jean Boussier*
296
146
 
297
- * Fix the `Digest::UUID.uuid_from_hash` behavior for namespace IDs that are different from the ones defined on `Digest::UUID`.
298
-
299
- The new behavior will be enabled by setting the
300
- `config.active_support.use_rfc4122_namespaced_uuids` option to `true`
301
- and is the default for new apps.
302
-
303
- The old behavior is the default for upgraded apps and will output a
304
- deprecation warning every time a value that is different than one of
305
- the constants defined on the `Digest::UUID` extension is used as the
306
- namespace ID.
307
-
308
- *Alex Robbin*, *Erich Soares Machado*, *Eugene Kenny*
309
-
310
- * `ActiveSupport::Inflector::Inflections#clear(:acronyms)` is now supported,
311
- and `inflector.clear` / `inflector.clear(:all)` also clears acronyms.
312
-
313
- *Alex Ghiculescu*, *Oliver Peate*
314
-
315
-
316
- ## Rails 7.0.0.alpha2 (September 15, 2021) ##
317
-
318
- * No changes.
319
-
320
-
321
- ## Rails 7.0.0.alpha1 (September 15, 2021) ##
322
-
323
- * `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.
147
+ * Make `ActiveSupport::BacktraceCleaner` copy filters and silencers on dup and clone.
324
148
 
325
- *Xavier Noria*
326
-
327
- * Private internal classes of `ActiveSupport::Dependencies` have been deleted, like `ActiveSupport::Dependencies::Reference`, `ActiveSupport::Dependencies::Blamable`, and others.
328
-
329
- *Xavier Noria*
330
-
331
- * The private API of `ActiveSupport::Dependencies` has been deleted. That includes methods like `hook!`, `unhook!`, `depend_on`, `require_or_load`, `mechanism`, and many others.
332
-
333
- *Xavier Noria*
334
-
335
- * Improves the performance of `ActiveSupport::NumberHelper` formatters by avoiding the use of exceptions as flow control.
336
-
337
- *Mike Dalessio*
338
-
339
- * Removed rescue block from `ActiveSupport::Cache::RedisCacheStore#handle_exception`
340
-
341
- Previously, if you provided a `error_handler` to `redis_cache_store`, any errors thrown by
342
- the error handler would be rescued and logged only. Removed the `rescue` clause from `handle_exception`
343
- to allow these to be thrown.
344
-
345
- *Nicholas A. Stuart*
346
-
347
- * Allow entirely opting out of deprecation warnings.
149
+ Previously the copy would still share the internal silencers and filters array,
150
+ causing state to leak.
348
151
 
349
- Previously if you did `app.config.active_support.deprecation = :silence`, some work would
350
- still be done on each call to `ActiveSupport::Deprecation.warn`. In very hot paths, this could
351
- cause performance issues.
152
+ *Jean Boussier*
352
153
 
353
- Now, you can make `ActiveSupport::Deprecation.warn` a no-op:
154
+ * Updating Astana with Western Kazakhstan TZInfo identifier.
354
155
 
355
- ```ruby
356
- config.active_support.report_deprecations = false
357
- ```
156
+ *Damian Nelson*
358
157
 
359
- This is the default in production for new apps. It is the equivalent to:
158
+ * Add filename support for `ActiveSupport::Logger.logger_outputs_to?`.
360
159
 
361
160
  ```ruby
362
- config.active_support.deprecation = :silence
363
- config.active_support.disallowed_deprecation = :silence
161
+ logger = Logger.new('/var/log/rails.log')
162
+ ActiveSupport::Logger.logger_outputs_to?(logger, '/var/log/rails.log')
364
163
  ```
365
164
 
366
- but will take a more optimised code path.
367
-
368
- *Alex Ghiculescu*
165
+ *Christian Schmidt*
369
166
 
370
- * Faster tests by parallelizing only when overhead is justified by the number
371
- of them.
167
+ * Include `IPAddr#prefix` when serializing an `IPAddr` using the
168
+ `ActiveSupport::MessagePack` serializer.
372
169
 
373
- Running tests in parallel adds overhead in terms of database
374
- setup and fixture loading. Now, Rails will only parallelize test executions when
375
- there are enough tests to make it worth it.
170
+ This change is backward and forward compatible old payloads can
171
+ still be read, and new payloads will be readable by older versions of Rails.
376
172
 
377
- This threshold is 50 by default, and is configurable via config setting in
378
- your test.rb:
379
-
380
- ```ruby
381
- config.active_support.test_parallelization_threshold = 100
382
- ```
173
+ *Taiki Komaba*
383
174
 
384
- It's also configurable at the test case level:
175
+ * Add `default:` support for `ActiveSupport::CurrentAttributes.attribute`.
385
176
 
386
177
  ```ruby
387
- class ActiveSupport::TestCase
388
- parallelize threshold: 100
178
+ class Current < ActiveSupport::CurrentAttributes
179
+ attribute :counter, default: 0
389
180
  end
390
181
  ```
391
182
 
392
- *Jorge Manrubia*
393
-
394
- * OpenSSL constants are now used for Digest computations.
395
-
396
- *Dirkjan Bussink*
183
+ *Sean Doyle*
397
184
 
398
- * `TimeZone.iso8601` now accepts valid ordinal values similar to Ruby's `Date._iso8601` method.
399
- A valid ordinal value will be converted to an instance of `TimeWithZone` using the `:year`
400
- and `:yday` fragments returned from `Date._iso8601`.
185
+ * Yield instance to `Object#with` block.
401
186
 
402
187
  ```ruby
403
- twz = ActiveSupport::TimeZone["Eastern Time (US & Canada)"].iso8601("21087")
404
- twz.to_a[0, 6] == [0, 0, 0, 28, 03, 2021]
188
+ client.with(timeout: 5_000) do |c|
189
+ c.get("/commits")
190
+ end
405
191
  ```
406
192
 
407
- *Steve Laing*
408
-
409
- * `Time#change` and methods that call it (e.g. `Time#advance`) will now
410
- return a `Time` with the timezone argument provided, if the caller was
411
- initialized with a timezone argument.
412
-
413
- Fixes [#42467](https://github.com/rails/rails/issues/42467).
193
+ *Sean Doyle*
414
194
 
415
- *Alex Ghiculescu*
195
+ * Use logical core count instead of physical core count to determine the
196
+ default number of workers when parallelizing tests.
416
197
 
417
- * Allow serializing any module or class to JSON by name.
198
+ *Jonathan Hefner*
418
199
 
419
- *Tyler Rick*, *Zachary Scott*
200
+ * Fix `Time.now/DateTime.now/Date.today` to return results in a system timezone after `#travel_to`.
420
201
 
421
- * Raise `ActiveSupport::EncryptedFile::MissingKeyError` when the
422
- `RAILS_MASTER_KEY` environment variable is blank (e.g. `""`).
202
+ There is a bug in the current implementation of #travel_to:
203
+ it remembers a timezone of its argument, and all stubbed methods start
204
+ returning results in that remembered timezone. However, the expected
205
+ behavior is to return results in a system timezone.
423
206
 
424
- *Sunny Ripert*
207
+ *Aleksei Chernenkov*
425
208
 
426
- * The `from:` option is added to `ActiveSupport::TestCase#assert_no_changes`.
209
+ * Add `ErrorReported#unexpected` to report precondition violations.
427
210
 
428
- It permits asserting on the initial value that is expected not to change.
211
+ For example:
429
212
 
430
213
  ```ruby
431
- assert_no_changes -> { Status.all_good? }, from: true do
432
- post :create, params: { status: { ok: true } }
214
+ def edit
215
+ if published?
216
+ Rails.error.unexpected("[BUG] Attempting to edit a published article, that shouldn't be possible")
217
+ return false
218
+ end
219
+ # ...
433
220
  end
434
221
  ```
435
222
 
436
- *George Claghorn*
437
-
438
- * Deprecate `ActiveSupport::SafeBuffer`'s incorrect implicit conversion of objects into string.
439
-
440
- Except for a few methods like `String#%`, objects must implement `#to_str`
441
- to be implicitly converted to a String in string operations. In some
442
- circumstances `ActiveSupport::SafeBuffer` was incorrectly calling the
443
- explicit conversion method (`#to_s`) on them. This behavior is now
444
- deprecated.
445
-
446
- *Jean Boussier*
447
-
448
- * Allow nested access to keys on `Rails.application.credentials`.
449
-
450
- Previously only top level keys in `credentials.yml.enc` could be accessed with method calls. Now any key can.
451
-
452
- For example, given these secrets:
453
-
454
- ```yml
455
- aws:
456
- access_key_id: 123
457
- secret_access_key: 345
458
- ```
459
-
460
- `Rails.application.credentials.aws.access_key_id` will now return the same thing as
461
- `Rails.application.credentials.aws[:access_key_id]`.
462
-
463
- *Alex Ghiculescu*
464
-
465
- * Added a faster and more compact `ActiveSupport::Cache` serialization format.
466
-
467
- It can be enabled with `config.active_support.cache_format_version = 7.0` or
468
- `config.load_defaults 7.0`. Regardless of the configuration Active Support
469
- 7.0 can read cache entries serialized by Active Support 6.1 which allows to
470
- upgrade without invalidating the cache. However Rails 6.1 can't read the
471
- new format, so all readers must be upgraded before the new format is enabled.
472
-
473
- *Jean Boussier*
474
-
475
- * Add `Enumerable#sole`, per `ActiveRecord::FinderMethods#sole`. Returns the
476
- sole item of the enumerable, raising if no items are found, or if more than
477
- one is.
478
-
479
- *Asherah Connor*
480
-
481
- * Freeze `ActiveSupport::Duration#parts` and remove writer methods.
482
-
483
- Durations are meant to be value objects and should not be mutated.
484
-
485
- *Andrew White*
486
-
487
- * Fix `ActiveSupport::TimeZone#utc_to_local` with fractional seconds.
488
-
489
- When `utc_to_local_returns_utc_offset_times` is false and the time
490
- instance had fractional seconds the new UTC time instance was out by
491
- a factor of 1,000,000 as the `Time.utc` constructor takes a usec
492
- value and not a fractional second value.
493
-
494
- *Andrew White*
495
-
496
- * Add `expires_at` argument to `ActiveSupport::Cache` `write` and `fetch` to set a cache entry TTL as an absolute time.
497
-
498
- ```ruby
499
- Rails.cache.write(key, value, expires_at: Time.now.at_end_of_hour)
500
- ```
223
+ The above will raise an error in development and test, but only report the error in production.
501
224
 
502
225
  *Jean Boussier*
503
226
 
504
- * Deprecate `ActiveSupport::TimeWithZone.name` so that from Rails 7.1 it will use the default implementation.
505
-
506
- *Andrew White*
507
-
508
- * Deprecates Rails custom `Enumerable#sum` and `Array#sum` in favor of Ruby's native implementation which
509
- is considerably faster.
510
-
511
- Ruby requires an initializer for non-numeric type as per examples below:
512
-
513
- ```ruby
514
- %w[foo bar].sum('')
515
- # instead of %w[foo bar].sum
516
-
517
- [[1, 2], [3, 4, 5]].sum([])
518
- # instead of [[1, 2], [3, 4, 5]].sum
519
- ```
520
-
521
- *Alberto Mota*
522
-
523
- * Tests parallelization is now disabled when running individual files to prevent the setup overhead.
524
-
525
- It can still be enforced if the environment variable `PARALLEL_WORKERS` is present and set to a value greater than 1.
526
-
527
- *Ricardo Díaz*
227
+ * Make the order of read_multi and write_multi notifications for `Cache::Store#fetch_multi` operations match the order they are executed in.
528
228
 
529
- * Fix proxying keyword arguments in `ActiveSupport::CurrentAttributes`.
229
+ *Adam Renberg Tamm*
530
230
 
531
- *Marcin Kołodziej*
231
+ * Make return values of `Cache::Store#write` consistent.
532
232
 
533
- * Add `Enumerable#maximum` and `Enumerable#minimum` to easily calculate the maximum or minimum from extracted
534
- elements of an enumerable.
233
+ The return value was not specified before. Now it returns `true` on a successful write,
234
+ `nil` if there was an error talking to the cache backend, and `false` if the write failed
235
+ for another reason (e.g. the key already exists and `unless_exist: true` was passed).
535
236
 
536
- ```ruby
537
- payments = [Payment.new(5), Payment.new(15), Payment.new(10)]
538
-
539
- payments.minimum(:price) # => 5
540
- payments.maximum(:price) # => 15
541
- ```
542
-
543
- This also allows passing enumerables to `fresh_when` and `stale?` in Action Controller.
544
- See PR [#41404](https://github.com/rails/rails/pull/41404) for an example.
237
+ *Sander Verdonschot*
545
238
 
546
- *Ayrton De Craene*
547
-
548
- * `ActiveSupport::Cache::MemCacheStore` now accepts an explicit `nil` for its `addresses` argument.
549
-
550
- ```ruby
551
- config.cache_store = :mem_cache_store, nil
239
+ * Fix logged cache keys not always matching actual key used by cache action.
552
240
 
553
- # is now equivalent to
554
-
555
- config.cache_store = :mem_cache_store
241
+ *Hartley McGuire*
556
242
 
557
- # and is also equivalent to
243
+ * Improve error messages of `assert_changes` and `assert_no_changes`.
558
244
 
559
- config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211"
245
+ `assert_changes` error messages now display objects with `.inspect` to make it easier
246
+ to differentiate nil from empty strings, strings from symbols, etc.
247
+ `assert_no_changes` error messages now surface the actual value.
560
248
 
561
- # which is the fallback behavior of Dalli
562
- ```
249
+ *pcreux*
563
250
 
564
- This helps those migrating from `:dalli_store`, where an explicit `nil` was permitted.
251
+ * Fix `#to_fs(:human_size)` to correctly work with negative numbers.
565
252
 
566
- *Michael Overmeyer*
253
+ *Earlopain*
567
254
 
568
- * Add `Enumerable#in_order_of` to put an Enumerable in a certain order by a key.
255
+ * Fix `BroadcastLogger#dup` so that it duplicates the logger's `broadcasts`.
569
256
 
570
- *DHH*
257
+ *Andrew Novoselac*
571
258
 
572
- * `ActiveSupport::Inflector.camelize` behaves expected when provided a symbol `:upper` or `:lower` argument. Matches
573
- `String#camelize` behavior.
259
+ * Fix issue where `bootstrap.rb` overwrites the `level` of a `BroadcastLogger`'s `broadcasts`.
574
260
 
575
- *Alex Ghiculescu*
261
+ *Andrew Novoselac*
576
262
 
577
- * Raises an `ArgumentError` when the first argument of `ActiveSupport::Notification.subscribe` is
578
- invalid.
263
+ * Fix compatibility with the `semantic_logger` gem.
579
264
 
580
- *Vipul A M*
265
+ The `semantic_logger` gem doesn't behave exactly like stdlib logger in that
266
+ `SemanticLogger#level` returns a Symbol while stdlib `Logger#level` returns an Integer.
581
267
 
582
- * `HashWithIndifferentAccess#deep_transform_keys` now returns a `HashWithIndifferentAccess` instead of a `Hash`.
268
+ This caused the various `LogSubscriber` classes in Rails to break when assigned a
269
+ `SemanticLogger` instance.
583
270
 
584
- *Nathaniel Woodthorpe*
271
+ *Jean Boussier*, *ojab*
585
272
 
586
- * Consume dalli’s `cache_nils` configuration as `ActiveSupport::Cache`'s `skip_nil` when using `MemCacheStore`.
273
+ * Fix MemoryStore to prevent race conditions when incrementing or decrementing.
587
274
 
588
- *Ritikesh G*
275
+ *Pierre Jambet*
589
276
 
590
- * Add `RedisCacheStore#stats` method similar to `MemCacheStore#stats`. Calls `redis#info` internally.
277
+ * Implement `HashWithIndifferentAccess#to_proc`.
591
278
 
592
- *Ritikesh G*
279
+ Previously, calling `#to_proc` on `HashWithIndifferentAccess` object used inherited `#to_proc`
280
+ method from the `Hash` class, which was not able to access values using indifferent keys.
593
281
 
282
+ *fatkodima*
594
283
 
595
- Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/activesupport/CHANGELOG.md) for previous changes.
284
+ Please check [7-1-stable](https://github.com/rails/rails/blob/7-1-stable/activesupport/CHANGELOG.md) for previous changes.