activesupport 6.0.3 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of activesupport might be problematic. Click here for more details.

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