activejob 7.0.0 → 7.0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ae2d6cd0db3d7b8f537207fc2a1ca24c367a99d342f5df41f528a36d78b8bdc
4
- data.tar.gz: f4fa7e7a47dbfc76f27efb80784da27ea752e7c439ced3cda38be6dd9433ad9b
3
+ metadata.gz: cf8e77a851870c5a26f00f6a9b4e37b35ce4fa3f7037f1c7994d67e0866d0ab3
4
+ data.tar.gz: 6715aa72093dc9d7e4fc59a8f36cad29f2abc78c6b9d971cd80edf8037d0b381
5
5
  SHA512:
6
- metadata.gz: 3f69f0725c4795278cbec6122722ff8646855a27590c32b8fe01bf2c2d11b7f3d5ebb55480dc22328bd71ed101402c6a5d7b7566545899b97faf4ea67b099821
7
- data.tar.gz: d2d1bda340ca28b512243d1feae203482a4f965746723329d135fedf6b0a100eb658cb9b8108e12d57c04a494b419cb3d4843c9c19a9265ee83af3082520873b
6
+ metadata.gz: 072cdf37dc4e8c6f4b3a9d8d21cfcdeafa0b4c8dd76b6c4d81fda996ade90d456317be8c2eafb5dcf98712d66eba0b3da70ffa8cfd1a6d8b2234e5c6d25b6784
7
+ data.tar.gz: 0dc660789c71d5df7df7208e4123083672a4a326521cc9ecc07b4f8fbc60f3ae1ed7e3e75ee75874b4ba5e5cb2a799d65f7ae0e07006e1ecfc6fd45c19976c1f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,52 @@
1
+ ## Rails 7.0.2.2 (February 11, 2022) ##
2
+
3
+ * No changes.
4
+
5
+
6
+ ## Rails 7.0.2.1 (February 11, 2022) ##
7
+
8
+ * No changes.
9
+
10
+
11
+ ## Rails 7.0.2 (February 08, 2022) ##
12
+
13
+ * No changes.
14
+
15
+
16
+ ## Rails 7.0.1 (January 06, 2022) ##
17
+
18
+ * Allow testing `discard_on/retry_on ActiveJob::DeserializationError`
19
+
20
+ Previously in `perform_enqueued_jobs`, `deserialize_arguments_if_needed`
21
+ was called before calling `perform_now`. When a record no longer exists
22
+ and is serialized using GlobalID this led to raising
23
+ an `ActiveJob::DeserializationError` before reaching `perform_now` call.
24
+ This behaviour makes difficult testing the job `discard_on/retry_on` logic.
25
+
26
+ Now `deserialize_arguments_if_needed` call is postponed to when `perform_now`
27
+ is called.
28
+
29
+ Example:
30
+
31
+ ```ruby
32
+ class UpdateUserJob < ActiveJob::Base
33
+ discard_on ActiveJob::DeserializationError
34
+
35
+ def perform(user)
36
+ # ...
37
+ end
38
+ end
39
+
40
+ # In the test
41
+ User.destroy_all
42
+ assert_nothing_raised do
43
+ perform_enqueued_jobs only: UpdateUserJob
44
+ end
45
+ ```
46
+
47
+ *Jacopo Beschi*
48
+
49
+
1
50
  ## Rails 7.0.0 (December 15, 2021) ##
2
51
 
3
52
  * No changes.
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014-2021 David Heinemeier Hansson
1
+ Copyright (c) 2014-2022 David Heinemeier Hansson
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -9,8 +9,8 @@ module ActiveJob
9
9
  module VERSION
10
10
  MAJOR = 7
11
11
  MINOR = 0
12
- TINY = 0
13
- PRE = nil
12
+ TINY = 2
13
+ PRE = "2"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -688,7 +688,7 @@ module ActiveJob
688
688
  enqueued_jobs_with(only: only, except: except, queue: queue, at: at) do |payload|
689
689
  queue_adapter.enqueued_jobs.delete(payload)
690
690
  queue_adapter.performed_jobs << payload
691
- instantiate_job(payload).perform_now
691
+ instantiate_job(payload, skip_deserialize_arguments: true).perform_now
692
692
  end.count
693
693
  end
694
694
 
@@ -708,10 +708,10 @@ module ActiveJob
708
708
  end
709
709
  end
710
710
 
711
- def instantiate_job(payload)
711
+ def instantiate_job(payload, skip_deserialize_arguments: false)
712
712
  job = payload[:job].deserialize(payload)
713
713
  job.scheduled_at = Time.at(payload[:at]) if payload.key?(:at)
714
- job.send(:deserialize_arguments_if_needed)
714
+ job.send(:deserialize_arguments_if_needed) unless skip_deserialize_arguments
715
715
  job
716
716
  end
717
717
 
data/lib/active_job.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #--
4
- # Copyright (c) 2014-2021 David Heinemeier Hansson
4
+ # Copyright (c) 2014-2022 David Heinemeier Hansson
5
5
  #
6
6
  # Permission is hereby granted, free of charge, to any person obtaining
7
7
  # a copy of this software and associated documentation files (the
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.0.0
4
+ version: 7.0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-15 00:00:00.000000000 Z
11
+ date: 2022-02-11 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.0.0
19
+ version: 7.0.2.2
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.0.0
26
+ version: 7.0.2.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: globalid
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -100,12 +100,12 @@ licenses:
100
100
  - MIT
101
101
  metadata:
102
102
  bug_tracker_uri: https://github.com/rails/rails/issues
103
- changelog_uri: https://github.com/rails/rails/blob/v7.0.0/activejob/CHANGELOG.md
104
- documentation_uri: https://api.rubyonrails.org/v7.0.0/
103
+ changelog_uri: https://github.com/rails/rails/blob/v7.0.2.2/activejob/CHANGELOG.md
104
+ documentation_uri: https://api.rubyonrails.org/v7.0.2.2/
105
105
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
106
- source_code_uri: https://github.com/rails/rails/tree/v7.0.0/activejob
106
+ source_code_uri: https://github.com/rails/rails/tree/v7.0.2.2/activejob
107
107
  rubygems_mfa_required: 'true'
108
- post_install_message:
108
+ post_install_message:
109
109
  rdoc_options: []
110
110
  require_paths:
111
111
  - lib
@@ -120,8 +120,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  - !ruby/object:Gem::Version
121
121
  version: '0'
122
122
  requirements: []
123
- rubygems_version: 3.2.32
124
- signing_key:
123
+ rubygems_version: 3.2.22
124
+ signing_key:
125
125
  specification_version: 4
126
126
  summary: Job framework with pluggable queues.
127
127
  test_files: []