activesupport 8.1.2.1 → 8.1.3
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +35 -0
- data/lib/active_support/cache/mem_cache_store.rb +3 -0
- data/lib/active_support/core_ext/benchmark.rb +0 -5
- data/lib/active_support/core_ext/string/inflections.rb +1 -1
- data/lib/active_support/core_ext.rb +1 -1
- data/lib/active_support/execution_context.rb +11 -0
- data/lib/active_support/gem_version.rb +2 -2
- data/lib/active_support/inflector/inflections.rb +2 -1
- data/lib/active_support/inflector/methods.rb +1 -1
- data/lib/active_support/json/encoding.rb +3 -1
- data/lib/active_support/railtie.rb +1 -1
- data/lib/active_support/testing/assertions.rb +3 -0
- data/lib/active_support/testing/error_reporter_assertions.rb +1 -1
- data/lib/active_support/testing/parallelization/worker.rb +6 -4
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c80ab1d4d255b732c83bfb5b5d7da9e0ac3230629235966d792cb90af243133d
|
|
4
|
+
data.tar.gz: 30a9eb194ddb042db345b574c058ada1719c6da30a2d4b5705590daa3a7688ca
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fd6accf7d8d788a12ebae56dadeed982f6e2f58d1403ac8b609926aa03e3a72b5c6065729514cf989f5473e2ff274a64629dbdb9e6184c8cf177d1a255923a85
|
|
7
|
+
data.tar.gz: '083bae87b3dfa3488580a76f1fd336f4b4565fcbad97f0c2e9ef1a38642e27c02a50f53880692fa2695fae37e3efbf9a1a6a1b240fe5ea103a056756104064e0'
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
|
+
## Rails 8.1.3 (March 24, 2026) ##
|
|
2
|
+
|
|
3
|
+
* Fix `JSONGemCoderEncoder` to correctly serialize custom object hash keys.
|
|
4
|
+
|
|
5
|
+
When hash keys are custom objects whose `as_json` returns a Hash,
|
|
6
|
+
the encoder now calls `to_s` on the original key object instead of
|
|
7
|
+
on the `as_json` result.
|
|
8
|
+
|
|
9
|
+
Before:
|
|
10
|
+
hash = {CustomKey.new(123) => "value"}
|
|
11
|
+
hash.to_json # => {"{:id=>123}":"value"}
|
|
12
|
+
|
|
13
|
+
After:
|
|
14
|
+
hash.to_json # => {"custom_123":"value"}
|
|
15
|
+
|
|
16
|
+
*Dan Sharp*
|
|
17
|
+
|
|
18
|
+
* Fix inflections to better handle overlapping acronyms.
|
|
19
|
+
|
|
20
|
+
```ruby
|
|
21
|
+
ActiveSupport::Inflector.inflections(:en) do |inflect|
|
|
22
|
+
inflect.acronym "USD"
|
|
23
|
+
inflect.acronym "USDC"
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
"USDC".underscore # => "usdc"
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
*Said Kaldybaev*
|
|
30
|
+
|
|
31
|
+
* Silence Dalli 4.0+ warning when using `ActiveSupport::Cache::MemCacheStore`.
|
|
32
|
+
|
|
33
|
+
*zzak*
|
|
34
|
+
|
|
35
|
+
|
|
1
36
|
## Rails 8.1.2.1 (March 23, 2026) ##
|
|
2
37
|
|
|
3
38
|
* Reject scientific notation in NumberConverter
|
|
@@ -90,6 +90,9 @@ module ActiveSupport
|
|
|
90
90
|
# The value "compress: false" prevents duplicate compression within Dalli.
|
|
91
91
|
@mem_cache_options[:compress] = false
|
|
92
92
|
(OVERRIDDEN_OPTIONS - %i(compress)).each { |name| @mem_cache_options.delete(name) }
|
|
93
|
+
# Set the default serializer for Dalli to prevent warning about
|
|
94
|
+
# inheriting the default serializer.
|
|
95
|
+
@mem_cache_options[:serializer] = Marshal
|
|
93
96
|
@data = self.class.build_mem_cache(*(addresses + [@mem_cache_options]))
|
|
94
97
|
end
|
|
95
98
|
|
|
@@ -1,6 +1 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Remove this file from activesupport/lib/active_support/core_ext.rb when deleting the deprecation.
|
|
4
|
-
ActiveSupport.deprecator.warn <<~TEXT
|
|
5
|
-
active_support/core_ext/benchmark.rb is deprecated and will be removed in Rails 8.2 without replacement.
|
|
6
|
-
TEXT
|
|
@@ -248,7 +248,7 @@ class String
|
|
|
248
248
|
# optional parameter +capitalize+ to false.
|
|
249
249
|
# By default, this parameter is true.
|
|
250
250
|
#
|
|
251
|
-
# The trailing '_id' can be kept
|
|
251
|
+
# The trailing '_id' can be kept by setting the
|
|
252
252
|
# optional parameter +keep_id_suffix+ to true.
|
|
253
253
|
# By default, this parameter is false.
|
|
254
254
|
#
|
|
@@ -23,6 +23,13 @@ module ActiveSupport
|
|
|
23
23
|
@store = @stack.pop
|
|
24
24
|
self
|
|
25
25
|
end
|
|
26
|
+
|
|
27
|
+
def flush
|
|
28
|
+
@stack = Array.new(@stack.size) { {} }
|
|
29
|
+
@store = {}
|
|
30
|
+
@current_attributes_instances = {}
|
|
31
|
+
self
|
|
32
|
+
end
|
|
26
33
|
end
|
|
27
34
|
|
|
28
35
|
@after_change_callbacks = []
|
|
@@ -97,6 +104,10 @@ module ActiveSupport
|
|
|
97
104
|
IsolatedExecutionState[:active_support_execution_context] = nil
|
|
98
105
|
end
|
|
99
106
|
|
|
107
|
+
def flush
|
|
108
|
+
record.flush
|
|
109
|
+
end
|
|
110
|
+
|
|
100
111
|
def current_attributes_instances
|
|
101
112
|
record.current_attributes_instances
|
|
102
113
|
end
|
|
@@ -265,7 +265,8 @@ module ActiveSupport
|
|
|
265
265
|
|
|
266
266
|
private
|
|
267
267
|
def define_acronym_regex_patterns
|
|
268
|
-
|
|
268
|
+
sorted_acronyms = @acronyms.empty? ? [] : @acronyms.values.sort_by { |a| -a.length }
|
|
269
|
+
@acronym_regex = sorted_acronyms.empty? ? /(?=a)b/ : /#{sorted_acronyms.join("|")}/
|
|
269
270
|
@acronyms_camelize_regex = /^(?:#{@acronym_regex}(?=\b|[A-Z_])|\w)/
|
|
270
271
|
@acronyms_underscore_regex = /(?:(?<=([A-Za-z\d]))|\b)(#{@acronym_regex})(?=\b|[^a-z])/
|
|
271
272
|
end
|
|
@@ -119,7 +119,7 @@ module ActiveSupport
|
|
|
119
119
|
# The capitalization of the first word can be turned off by setting the
|
|
120
120
|
# +:capitalize+ option to false (default is true).
|
|
121
121
|
#
|
|
122
|
-
# The trailing '_id' can be kept
|
|
122
|
+
# The trailing '_id' can be kept by setting the
|
|
123
123
|
# optional parameter +keep_id_suffix+ to true (default is false).
|
|
124
124
|
#
|
|
125
125
|
# humanize('employee_salary') # => "Employee salary"
|
|
@@ -151,8 +151,10 @@ module ActiveSupport
|
|
|
151
151
|
JSON_NATIVE_TYPES = [Hash, Array, Float, String, Symbol, Integer, NilClass, TrueClass, FalseClass, ::JSON::Fragment].freeze
|
|
152
152
|
CODER = ::JSON::Coder.new do |value, is_key|
|
|
153
153
|
json_value = value.as_json
|
|
154
|
+
|
|
154
155
|
# Keep compatibility by calling to_s on non-String keys
|
|
155
|
-
next
|
|
156
|
+
next value.to_s if is_key && !(String === json_value)
|
|
157
|
+
|
|
156
158
|
# Handle objects returning self from as_json
|
|
157
159
|
if json_value.equal?(value)
|
|
158
160
|
next ::JSON::Fragment.new(::JSON.generate(json_value))
|
|
@@ -49,7 +49,7 @@ module ActiveSupport
|
|
|
49
49
|
initializer "active_support.reset_execution_context" do |app|
|
|
50
50
|
app.reloader.before_class_unload do
|
|
51
51
|
ActiveSupport::CurrentAttributes.clear_all
|
|
52
|
-
ActiveSupport::ExecutionContext.
|
|
52
|
+
ActiveSupport::ExecutionContext.flush
|
|
53
53
|
ActiveSupport.event_reporter.clear_context
|
|
54
54
|
end
|
|
55
55
|
|
|
@@ -348,6 +348,9 @@ module ActiveSupport
|
|
|
348
348
|
lines[0] = lines[0].byteslice(location[1]...)
|
|
349
349
|
source = lines.join.strip
|
|
350
350
|
|
|
351
|
+
# Strip stabby lambda from Ruby 4.1+
|
|
352
|
+
source = source.sub(/^->\s*/, "")
|
|
353
|
+
|
|
351
354
|
# We ignore procs defined with do/end as they are likely multi-line anyway.
|
|
352
355
|
if source.start_with?("{")
|
|
353
356
|
source.delete_suffix!("}")
|
|
@@ -46,10 +46,12 @@ module ActiveSupport
|
|
|
46
46
|
|
|
47
47
|
set_process_title("#{klass}##{method}")
|
|
48
48
|
|
|
49
|
-
result =
|
|
50
|
-
Minitest.run_one_method
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
result = klass.with_info_handler reporter do
|
|
50
|
+
if Minitest.respond_to? :run_one_method
|
|
51
|
+
Minitest.run_one_method klass, method
|
|
52
|
+
else
|
|
53
|
+
klass.new(method).run
|
|
54
|
+
end
|
|
53
55
|
end
|
|
54
56
|
|
|
55
57
|
safe_record(reporter, result)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activesupport
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 8.1.
|
|
4
|
+
version: 8.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Heinemeier Hansson
|
|
@@ -501,10 +501,10 @@ licenses:
|
|
|
501
501
|
- MIT
|
|
502
502
|
metadata:
|
|
503
503
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
|
504
|
-
changelog_uri: https://github.com/rails/rails/blob/v8.1.
|
|
505
|
-
documentation_uri: https://api.rubyonrails.org/v8.1.
|
|
504
|
+
changelog_uri: https://github.com/rails/rails/blob/v8.1.3/activesupport/CHANGELOG.md
|
|
505
|
+
documentation_uri: https://api.rubyonrails.org/v8.1.3/
|
|
506
506
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
|
507
|
-
source_code_uri: https://github.com/rails/rails/tree/v8.1.
|
|
507
|
+
source_code_uri: https://github.com/rails/rails/tree/v8.1.3/activesupport
|
|
508
508
|
rubygems_mfa_required: 'true'
|
|
509
509
|
rdoc_options:
|
|
510
510
|
- "--encoding"
|