activejob 7.1.2 → 7.1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/lib/active_job/arguments.rb +19 -11
- data/lib/active_job/callbacks.rb +2 -1
- data/lib/active_job/gem_version.rb +2 -2
- data/lib/active_job/serializers/time_with_zone_serializer.rb +11 -2
- data/lib/active_job/test_helper.rb +3 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: febcf393a1862bd6faa124e8cd80d702dabec8e2d27a917ac2c6e6f1409266d6
|
4
|
+
data.tar.gz: 27335c305dc9e9f0ac7f9ef6953182ab99a27b55da1ceef7045c40465e0a4a3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29f1a4cdaf0080105d868d5dc2f40df966d91156e554512913e71e3a27ab737dd05cc3d178074305329775ffd87c2d42c832475b8c1984939c546bff3eb09721
|
7
|
+
data.tar.gz: 6de8050fd14754933d10dc5370079f642a7c4b1c563f0365f3106c52809d35304568eebd41b19fba291ed01cf40bbe093adf01e8aa96323fb861dd8c251d6d65
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
## Rails 7.1.3.1 (February 21, 2024) ##
|
2
|
+
|
3
|
+
* No changes.
|
4
|
+
|
5
|
+
|
6
|
+
## Rails 7.1.3 (January 16, 2024) ##
|
7
|
+
|
8
|
+
* Do not trigger immediate loading of `ActiveJob::Base` when loading `ActiveJob::TestHelper`.
|
9
|
+
|
10
|
+
*Maxime Réty*
|
11
|
+
|
12
|
+
* Preserve the serialized timezone when deserializing `ActiveSupport::TimeWithZone` arguments.
|
13
|
+
|
14
|
+
*Joshua Young*
|
15
|
+
|
16
|
+
* Fix ActiveJob arguments serialization to correctly serialize String subclasses having custom serializers.
|
17
|
+
|
18
|
+
*fatkodima*
|
19
|
+
|
20
|
+
|
1
21
|
## Rails 7.1.2 (November 10, 2023) ##
|
2
22
|
|
3
23
|
* No changes.
|
data/lib/active_job/arguments.rb
CHANGED
@@ -46,8 +46,6 @@ module ActiveJob
|
|
46
46
|
end
|
47
47
|
|
48
48
|
private
|
49
|
-
# :nodoc:
|
50
|
-
PERMITTED_TYPES = [ NilClass, String, Integer, Float, TrueClass, FalseClass ]
|
51
49
|
# :nodoc:
|
52
50
|
GLOBALID_KEY = "_aj_globalid"
|
53
51
|
# :nodoc:
|
@@ -67,13 +65,23 @@ module ActiveJob
|
|
67
65
|
OBJECT_SERIALIZER_KEY, OBJECT_SERIALIZER_KEY.to_sym,
|
68
66
|
WITH_INDIFFERENT_ACCESS_KEY, WITH_INDIFFERENT_ACCESS_KEY.to_sym,
|
69
67
|
]
|
70
|
-
private_constant :
|
68
|
+
private_constant :RESERVED_KEYS, :GLOBALID_KEY,
|
71
69
|
:SYMBOL_KEYS_KEY, :RUBY2_KEYWORDS_KEY, :WITH_INDIFFERENT_ACCESS_KEY
|
72
70
|
|
73
71
|
def serialize_argument(argument)
|
74
72
|
case argument
|
75
|
-
when
|
73
|
+
when nil, true, false, Integer, Float # Types that can hardly be subclassed
|
76
74
|
argument
|
75
|
+
when String
|
76
|
+
if argument.class == String
|
77
|
+
argument
|
78
|
+
else
|
79
|
+
begin
|
80
|
+
Serializers.serialize(argument)
|
81
|
+
rescue SerializationError
|
82
|
+
argument
|
83
|
+
end
|
84
|
+
end
|
77
85
|
when GlobalID::Identification
|
78
86
|
convert_to_global_id_hash(argument)
|
79
87
|
when Array
|
@@ -90,10 +98,10 @@ module ActiveJob
|
|
90
98
|
result = serialize_hash(argument)
|
91
99
|
result[aj_hash_key] = symbol_keys
|
92
100
|
result
|
93
|
-
when -> (arg) { arg.respond_to?(:permitted?) && arg.respond_to?(:to_h) }
|
94
|
-
serialize_indifferent_hash(argument.to_h)
|
95
101
|
else
|
96
|
-
if
|
102
|
+
if argument.respond_to?(:permitted?) && argument.respond_to?(:to_h)
|
103
|
+
serialize_indifferent_hash(argument.to_h)
|
104
|
+
elsif BigDecimal === argument && !ActiveJob.use_big_decimal_serializer
|
97
105
|
ActiveJob.deprecator.warn(<<~MSG)
|
98
106
|
Primitive serialization of BigDecimal job arguments is deprecated as it may serialize via .to_s using certain queue adapters.
|
99
107
|
Enable config.active_job.use_big_decimal_serializer to use BigDecimalSerializer instead, which will be mandatory in Rails 7.2.
|
@@ -101,16 +109,16 @@ module ActiveJob
|
|
101
109
|
Note that if your application has multiple replicas, you should only enable this setting after successfully deploying your app to Rails 7.1 first.
|
102
110
|
This will ensure that during your deployment all replicas are capable of deserializing arguments serialized with BigDecimalSerializer.
|
103
111
|
MSG
|
104
|
-
|
112
|
+
argument
|
113
|
+
else
|
114
|
+
Serializers.serialize(argument)
|
105
115
|
end
|
106
|
-
|
107
|
-
Serializers.serialize(argument)
|
108
116
|
end
|
109
117
|
end
|
110
118
|
|
111
119
|
def deserialize_argument(argument)
|
112
120
|
case argument
|
113
|
-
when
|
121
|
+
when nil, true, false, String, Integer, Float
|
114
122
|
argument
|
115
123
|
when BigDecimal # BigDecimal may have been legacy serialized; Remove in 7.2
|
116
124
|
argument
|
data/lib/active_job/callbacks.rb
CHANGED
@@ -132,7 +132,8 @@ module ActiveJob
|
|
132
132
|
# queue_as :default
|
133
133
|
#
|
134
134
|
# after_enqueue do |job|
|
135
|
-
#
|
135
|
+
# result = job.successfully_enqueued? ? "success" : "failure"
|
136
|
+
# $statsd.increment "enqueue-video-job.#{result}"
|
136
137
|
# end
|
137
138
|
#
|
138
139
|
# def perform(video_id)
|
@@ -2,9 +2,18 @@
|
|
2
2
|
|
3
3
|
module ActiveJob
|
4
4
|
module Serializers
|
5
|
-
class TimeWithZoneSerializer <
|
5
|
+
class TimeWithZoneSerializer < ObjectSerializer # :nodoc:
|
6
|
+
NANO_PRECISION = 9
|
7
|
+
|
8
|
+
def serialize(time_with_zone)
|
9
|
+
super(
|
10
|
+
"value" => time_with_zone.iso8601(NANO_PRECISION),
|
11
|
+
"time_zone" => time_with_zone.time_zone.tzinfo.name
|
12
|
+
)
|
13
|
+
end
|
14
|
+
|
6
15
|
def deserialize(hash)
|
7
|
-
Time.iso8601(hash["value"]).in_time_zone
|
16
|
+
Time.iso8601(hash["value"]).in_time_zone(hash["time_zone"] || Time.zone)
|
8
17
|
end
|
9
18
|
|
10
19
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activejob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.1.
|
4
|
+
version: 7.1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 7.1.
|
19
|
+
version: 7.1.3.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 7.1.
|
26
|
+
version: 7.1.3.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: globalid
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -102,10 +102,10 @@ licenses:
|
|
102
102
|
- MIT
|
103
103
|
metadata:
|
104
104
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
105
|
-
changelog_uri: https://github.com/rails/rails/blob/v7.1.
|
106
|
-
documentation_uri: https://api.rubyonrails.org/v7.1.
|
105
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.1.3.1/activejob/CHANGELOG.md
|
106
|
+
documentation_uri: https://api.rubyonrails.org/v7.1.3.1/
|
107
107
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
108
|
-
source_code_uri: https://github.com/rails/rails/tree/v7.1.
|
108
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.1.3.1/activejob
|
109
109
|
rubygems_mfa_required: 'true'
|
110
110
|
post_install_message:
|
111
111
|
rdoc_options: []
|
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
122
|
- !ruby/object:Gem::Version
|
123
123
|
version: '0'
|
124
124
|
requirements: []
|
125
|
-
rubygems_version: 3.4.
|
125
|
+
rubygems_version: 3.4.10
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
128
|
summary: Job framework with pluggable queues.
|