ae_active_job_state 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1747e2cb848f546f8b4210b75b3540fb60413a81fa2510dacf2d48acb010b86
4
- data.tar.gz: 7c0d074c03fc054d05b065192851c9de78d1b69e1a614b5e05671a589cc2a3fb
3
+ metadata.gz: 706322d5333d170413b8ea10f6828e23b97f7276fb1c3f4be925b4e1d3998612
4
+ data.tar.gz: 81fe635701a0c541832a7daf7a52d5a262e88ff4332eacbdf85ed3ee03a302b5
5
5
  SHA512:
6
- metadata.gz: 4b5edff3c15d307f646181ceeec2efc4b4ad4e025d65dc030bacf4930f2ccd0a6d3dcebb925524593ed58729c8bf4e32e077fcc915295538f8be6bc34119d50c
7
- data.tar.gz: 84ba277e93492eff5ba4c9fb3aeac0cb717cfe98a9d70970a11c9341d0c5ac00c6513eb90684452bf15a8da425e038c2c82d5bcab04bacdd4d48e86c344aca16
6
+ metadata.gz: 6ec715060434b6d894f83892b7d2e168fbd1de45b4375e9e9d697ef9037f7f661c52f4dda008b87c7450cc92ba34078d73978d436f4d0ca28d81eca8b3bdc417
7
+ data.tar.gz: 50d2d323c6c6dfb6d6e42b9cbd79a135208a04fb93e0fa99389947cf1e73f61c1234755d5b69b1bbdcb8a37c9f0e319f01bdcb1e29755f45e0f1e2525e973aba
@@ -13,7 +13,7 @@ module AeActiveJobState
13
13
  # `perform_now` would go directly to around_perform
14
14
  before_enqueue do |job|
15
15
  @job_state = AeActiveJobState::JobState.create!(status: 'pending', active_job_id: job.job_id,
16
- args: job.arguments)
16
+ args: job.arguments, worker_class: job.class)
17
17
  end
18
18
 
19
19
  around_perform do |job, block|
@@ -31,7 +31,7 @@ module AeActiveJobState
31
31
  # where the job was never enqueued.
32
32
  begin
33
33
  @job_state = AeActiveJobState::JobState.create!(status: 'pending', active_job_id: job.job_id,
34
- args: job.arguments)
34
+ args: job.arguments, worker_class: job.class)
35
35
  rescue ActiveRecord::RecordNotUnique, ActiveRecord::RecordInvalid
36
36
  @job_state = AeActiveJobState::JobState.find_by!(active_job_id: job.job_id)
37
37
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AeActiveJobState
4
- VERSION = '0.2.1'
4
+ VERSION = '0.3.0'
5
5
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddWorkerClassColumnToJobStateTable < ActiveRecord::Migration[6.0]
4
+ def change
5
+ change_table :ae_active_job_state_job_states do |t|
6
+ t.string :worker_class
7
+ end
8
+ end
9
+ end
@@ -6,8 +6,17 @@ class AeActiveJobStateGenerator < Rails::Generators::Base
6
6
  include ActiveRecord::Generators::Migration
7
7
 
8
8
  source_root File.expand_path('./ae_active_job_state/templates', __dir__)
9
+ class_option :since_version, default: '0.0.0'
10
+
11
+ MIGRATIONS = [
12
+ %w[0.1.0 create_ae_active_job_state_tables.rb],
13
+ %w[0.3.0 add_worker_class_column_to_job_state_table.rb]
14
+ ].freeze
9
15
 
10
16
  def copy_migrations
11
- migration_template 'create_ae_active_job_state_tables.rb', 'db/migrate/create_ae_active_job_state_tables.rb'
17
+ since_version = Gem::Version.new(options['since_version'])
18
+ MIGRATIONS.each do |version, file|
19
+ migration_template file, "db/migrate/#{file}" if Gem::Version.new(version) > since_version
20
+ end
12
21
  end
13
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ae_active_job_state
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - AppFolio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-22 00:00:00.000000000 Z
11
+ date: 2021-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aasm
@@ -97,6 +97,7 @@ files:
97
97
  - lib/ae_active_job_state/has_job_state.rb
98
98
  - lib/ae_active_job_state/job_state.rb
99
99
  - lib/ae_active_job_state/version.rb
100
+ - lib/generators/ae_active_job_state/templates/add_worker_class_column_to_job_state_table.rb
100
101
  - lib/generators/ae_active_job_state/templates/create_ae_active_job_state_tables.rb
101
102
  - lib/generators/ae_active_job_state_generator.rb
102
103
  homepage: https://github.com/appfolio/ae_active_job_state