activejob 8.1.1 → 8.1.2
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 +16 -0
- data/lib/active_job/arguments.rb +5 -5
- data/lib/active_job/enqueue_after_transaction_commit.rb +19 -0
- data/lib/active_job/gem_version.rb +1 -1
- data/lib/active_job/queue_adapters.rb +0 -1
- data/lib/active_job/railtie.rb +1 -1
- data/lib/active_job/serializers/object_serializer.rb +1 -1
- data/lib/active_job/serializers.rb +4 -1
- metadata +7 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b3a578cc3f9f7edc22dc86fba167b809a884264b4dd3a1191a9134f7b2620f84
|
|
4
|
+
data.tar.gz: 3d2f8faf8490ccaeb1b12f150b7c2f863b071451020ed79bbb4ae4dcd4f635e8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 56ab511d1418ff2d13a4fe6fb19336899006ebc0f07f56c1bcc2de83bb27425974804fc63d95db64988638d0401455f28e183b537af19a8ed741fdb05253c584
|
|
7
|
+
data.tar.gz: ce679bda3a7b4ba95a12c0555a0334d4db859ccd57821468d49c148d6231165d7c100b5d6ae951cb02c9812f2ccc0a521eb7547217a1b2aefd6a77394c6f79d4
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## Rails 8.1.2 (January 08, 2026) ##
|
|
2
|
+
|
|
3
|
+
* Fix `ActiveJob.perform_all_later` to respect `job_class.enqueue_after_transaction_commit`.
|
|
4
|
+
|
|
5
|
+
Previously, `perform_all_later` would enqueue all jobs immediately, even if
|
|
6
|
+
they had `enqueue_after_transaction_commit = true`. Now it correctly defers
|
|
7
|
+
jobs with this setting until after transaction commits, matching the behavior
|
|
8
|
+
of `perform_later`.
|
|
9
|
+
|
|
10
|
+
*OuYangJinTing*
|
|
11
|
+
|
|
12
|
+
* Fix using custom serializers with `ActiveJob::Arguments.serialize` when
|
|
13
|
+
`ActiveJob::Base` hasn't been loaded.
|
|
14
|
+
|
|
15
|
+
*Hartley McGuire*
|
|
16
|
+
|
|
1
17
|
## Rails 8.1.1 (October 28, 2025) ##
|
|
2
18
|
|
|
3
19
|
* Only index new serializers.
|
data/lib/active_job/arguments.rb
CHANGED
|
@@ -50,7 +50,7 @@ module ActiveJob
|
|
|
50
50
|
end
|
|
51
51
|
end
|
|
52
52
|
when Symbol
|
|
53
|
-
{ OBJECT_SERIALIZER_KEY => "ActiveJob::Serializers::SymbolSerializer", "value" => argument.name }
|
|
53
|
+
{ Serializers::OBJECT_SERIALIZER_KEY => "ActiveJob::Serializers::SymbolSerializer", "value" => argument.name }
|
|
54
54
|
when GlobalID::Identification
|
|
55
55
|
convert_to_global_id_hash(argument)
|
|
56
56
|
when Array
|
|
@@ -94,15 +94,13 @@ module ActiveJob
|
|
|
94
94
|
RUBY2_KEYWORDS_KEY = "_aj_ruby2_keywords"
|
|
95
95
|
# :nodoc:
|
|
96
96
|
WITH_INDIFFERENT_ACCESS_KEY = "_aj_hash_with_indifferent_access"
|
|
97
|
-
# :nodoc:
|
|
98
|
-
OBJECT_SERIALIZER_KEY = "_aj_serialized"
|
|
99
97
|
|
|
100
98
|
# :nodoc:
|
|
101
99
|
RESERVED_KEYS = [
|
|
102
100
|
GLOBALID_KEY, GLOBALID_KEY.to_sym,
|
|
103
101
|
SYMBOL_KEYS_KEY, SYMBOL_KEYS_KEY.to_sym,
|
|
104
102
|
RUBY2_KEYWORDS_KEY, RUBY2_KEYWORDS_KEY.to_sym,
|
|
105
|
-
OBJECT_SERIALIZER_KEY, OBJECT_SERIALIZER_KEY.to_sym,
|
|
103
|
+
Serializers::OBJECT_SERIALIZER_KEY, Serializers::OBJECT_SERIALIZER_KEY.to_sym,
|
|
106
104
|
WITH_INDIFFERENT_ACCESS_KEY, WITH_INDIFFERENT_ACCESS_KEY.to_sym,
|
|
107
105
|
].to_set
|
|
108
106
|
private_constant :RESERVED_KEYS, :GLOBALID_KEY,
|
|
@@ -136,7 +134,7 @@ module ActiveJob
|
|
|
136
134
|
end
|
|
137
135
|
|
|
138
136
|
def custom_serialized?(hash)
|
|
139
|
-
hash.key?(OBJECT_SERIALIZER_KEY)
|
|
137
|
+
hash.key?(Serializers::OBJECT_SERIALIZER_KEY)
|
|
140
138
|
end
|
|
141
139
|
|
|
142
140
|
def serialize_hash(argument)
|
|
@@ -197,4 +195,6 @@ module ActiveJob
|
|
|
197
195
|
"without an id. (Maybe you forgot to call save?)"
|
|
198
196
|
end
|
|
199
197
|
end
|
|
198
|
+
|
|
199
|
+
ActiveSupport.run_load_hooks(:active_job_arguments, Arguments)
|
|
200
200
|
end
|
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
module ActiveJob
|
|
4
4
|
module EnqueueAfterTransactionCommit # :nodoc:
|
|
5
|
+
class << self
|
|
6
|
+
def included(base)
|
|
7
|
+
ActiveJob.singleton_class.prepend(ActiveJobMethods)
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
module ActiveJobMethods
|
|
12
|
+
# Ensures perform_all_later respects each job's enqueue_after_transaction_commit configuration.
|
|
13
|
+
# Jobs with enqueue_after_transaction_commit set to true are deferred and enqueued only after the transaction commits;
|
|
14
|
+
# other jobs are enqueued immediately. This ensures enqueuing timing matches the per-job setting.
|
|
15
|
+
def perform_all_later(*jobs)
|
|
16
|
+
jobs.flatten!
|
|
17
|
+
deferred_jobs, immediate_jobs = jobs.partition { |job| job.class.enqueue_after_transaction_commit }
|
|
18
|
+
super(immediate_jobs) if immediate_jobs.any?
|
|
19
|
+
ActiveRecord.after_all_transactions_commit { super(deferred_jobs) } if deferred_jobs.any?
|
|
20
|
+
nil
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
5
24
|
private
|
|
6
25
|
def raw_enqueue
|
|
7
26
|
if self.class.enqueue_after_transaction_commit
|
data/lib/active_job/railtie.rb
CHANGED
|
@@ -20,7 +20,7 @@ module ActiveJob
|
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
initializer "active_job.custom_serializers" do |app|
|
|
23
|
-
ActiveSupport.on_load(:
|
|
23
|
+
ActiveSupport.on_load(:active_job_arguments) do
|
|
24
24
|
custom_serializers = app.config.active_job.custom_serializers
|
|
25
25
|
ActiveJob::Serializers.add_serializers custom_serializers
|
|
26
26
|
end
|
|
@@ -30,7 +30,7 @@ module ActiveJob
|
|
|
30
30
|
|
|
31
31
|
def initialize
|
|
32
32
|
super
|
|
33
|
-
@template = {
|
|
33
|
+
@template = { Serializers::OBJECT_SERIALIZER_KEY => self.class.name }.freeze
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
# Determines if an argument should be serialized by a serializer.
|
|
@@ -38,7 +38,7 @@ module ActiveJob
|
|
|
38
38
|
# Will look up through all known serializers.
|
|
39
39
|
# If no serializer found will raise <tt>ArgumentError</tt>.
|
|
40
40
|
def deserialize(argument)
|
|
41
|
-
serializer_name = argument[
|
|
41
|
+
serializer_name = argument[OBJECT_SERIALIZER_KEY]
|
|
42
42
|
raise ArgumentError, "Serializer name is not present in the argument: #{argument.inspect}" unless serializer_name
|
|
43
43
|
|
|
44
44
|
serializer = serializer_name.safe_constantize
|
|
@@ -100,6 +100,9 @@ module ActiveJob
|
|
|
100
100
|
end
|
|
101
101
|
end
|
|
102
102
|
|
|
103
|
+
# :nodoc:
|
|
104
|
+
OBJECT_SERIALIZER_KEY = "_aj_serialized"
|
|
105
|
+
|
|
103
106
|
add_serializers SymbolSerializer.instance,
|
|
104
107
|
DurationSerializer.instance,
|
|
105
108
|
DateTimeSerializer.instance,
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activejob
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 8.1.
|
|
4
|
+
version: 8.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Heinemeier Hansson
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - '='
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 8.1.
|
|
18
|
+
version: 8.1.2
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - '='
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 8.1.
|
|
25
|
+
version: 8.1.2
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: globalid
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -108,10 +108,10 @@ licenses:
|
|
|
108
108
|
- MIT
|
|
109
109
|
metadata:
|
|
110
110
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
|
111
|
-
changelog_uri: https://github.com/rails/rails/blob/v8.1.
|
|
112
|
-
documentation_uri: https://api.rubyonrails.org/v8.1.
|
|
111
|
+
changelog_uri: https://github.com/rails/rails/blob/v8.1.2/activejob/CHANGELOG.md
|
|
112
|
+
documentation_uri: https://api.rubyonrails.org/v8.1.2/
|
|
113
113
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
|
114
|
-
source_code_uri: https://github.com/rails/rails/tree/v8.1.
|
|
114
|
+
source_code_uri: https://github.com/rails/rails/tree/v8.1.2/activejob
|
|
115
115
|
rubygems_mfa_required: 'true'
|
|
116
116
|
rdoc_options: []
|
|
117
117
|
require_paths:
|
|
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
127
127
|
- !ruby/object:Gem::Version
|
|
128
128
|
version: '0'
|
|
129
129
|
requirements: []
|
|
130
|
-
rubygems_version:
|
|
130
|
+
rubygems_version: 4.0.3
|
|
131
131
|
specification_version: 4
|
|
132
132
|
summary: Job framework with pluggable queues.
|
|
133
133
|
test_files: []
|