activejob 7.1.2 → 7.1.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +35 -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: c13b1ea6ba1e35ea17b2a2051b76b2d12912e746120f5c85170839cb43432e1f
|
4
|
+
data.tar.gz: fd72f8bf538fe535a8cc8faa22671392789459265618228cbeda8cee73cc0cf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bc47ff3a65ba512ce75d6f33c9bcf59319eb3e749753f961cf4073b8785d48816f7a28d373675f4d710886b5e967474ff9f543f6ec0e697418397990f09ac92
|
7
|
+
data.tar.gz: e69b622ce5699395aab14669d9afb5116743d6186530031c30a907c52ad8a622e08c256458d417af5fbeeb5a61e6a4c6a9fd4731ba38cb836e1b159004de75ea
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,38 @@
|
|
1
|
+
## Rails 7.1.3.4 (June 04, 2024) ##
|
2
|
+
|
3
|
+
* No changes.
|
4
|
+
|
5
|
+
|
6
|
+
## Rails 7.1.3.3 (May 16, 2024) ##
|
7
|
+
|
8
|
+
* No changes.
|
9
|
+
|
10
|
+
|
11
|
+
## Rails 7.1.3.2 (February 21, 2024) ##
|
12
|
+
|
13
|
+
* No changes.
|
14
|
+
|
15
|
+
|
16
|
+
## Rails 7.1.3.1 (February 21, 2024) ##
|
17
|
+
|
18
|
+
* No changes.
|
19
|
+
|
20
|
+
|
21
|
+
## Rails 7.1.3 (January 16, 2024) ##
|
22
|
+
|
23
|
+
* Do not trigger immediate loading of `ActiveJob::Base` when loading `ActiveJob::TestHelper`.
|
24
|
+
|
25
|
+
*Maxime Réty*
|
26
|
+
|
27
|
+
* Preserve the serialized timezone when deserializing `ActiveSupport::TimeWithZone` arguments.
|
28
|
+
|
29
|
+
*Joshua Young*
|
30
|
+
|
31
|
+
* Fix ActiveJob arguments serialization to correctly serialize String subclasses having custom serializers.
|
32
|
+
|
33
|
+
*fatkodima*
|
34
|
+
|
35
|
+
|
1
36
|
## Rails 7.1.2 (November 10, 2023) ##
|
2
37
|
|
3
38
|
* 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.4
|
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-06-04 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.4
|
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.4
|
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.4/activejob/CHANGELOG.md
|
106
|
+
documentation_uri: https://api.rubyonrails.org/v7.1.3.4/
|
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.4/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.
|
125
|
+
rubygems_version: 3.3.27
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
128
|
summary: Job framework with pluggable queues.
|