delayed_job_groups_plugin 0.6.0 → 0.6.2

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: '08082884f93f3a0b28ca97d8d212b5ad59defaf7ecc08987654e81433ee2f3ab'
4
- data.tar.gz: 6e1287e9ddced955fa2be1e29d4444c53051321908ba8e4b863bd41f44f2c6a9
3
+ metadata.gz: a6ebba61f2d0ba4a6ab2572a5648030c14b58ae99e4412fbd4a89257128f587a
4
+ data.tar.gz: 5c1457109671e7ab379f32d3a5e52750de3fd775fa83c3a70723fec29b146d0b
5
5
  SHA512:
6
- metadata.gz: f1e613c4575fba5d4c15a140ecb0968fe308d7f46bc229c87fd38b547d14fbd5aa80118b8bd73218a8024a0a342387cc06b566c88f36f91ab40215765db1e6e9
7
- data.tar.gz: a1684af456260bbe492af11d894837cfa5e4fb0c27cbc799e5df65b1aa08d51b1cdb869e99ec97a3de4f388449174243ddda99a64222c880f24b38377d0008f9
6
+ metadata.gz: f25332bf31e68b50e1925dd77407caaf0e577f997804dadb24a9c1fce0045353431d48187d69582b3884217a928df2a91157d4ee9e7d8c7e45889860222b89ba
7
+ data.tar.gz: ff86634ad4296c5c4f2e17cbc0acee72e1c9d97b567298565d2fa457ac69245f47348cc7551dbfe397a9fd8e552a1bd994e7f487cd5fe8cd7a0eaef3da75fd1c
@@ -1,7 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ### 0.6.2
4
+ * Defer including extension until delayed_job_active_record is loaded
5
+
6
+ ### 0.6.1
7
+ * Fix job_group_id `belongs_to` behavior when `config.active_record.belongs_to_required_by_default` is enabled.
8
+
3
9
  ### 0.6.0
4
- * A support for Rails 6.1.
10
+ * Add support for Rails 6.1.
5
11
 
6
12
  ### 0.5.0
7
13
  * Drop support for Ruby 2.3 and 2.4.
@@ -15,7 +15,7 @@ module Delayed
15
15
  attr_accessible :job_group_id, :blocked
16
16
  end
17
17
 
18
- belongs_to :job_group, class_name: 'Delayed::JobGroups::JobGroup'
18
+ belongs_to :job_group, class_name: 'Delayed::JobGroups::JobGroup', required: false
19
19
 
20
20
  class << self
21
21
  prepend ReadyToRunExtension
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Delayed
4
+ module JobGroups
5
+ class Railtie < ::Rails::Railtie
6
+ config.after_initialize do
7
+ Delayed::Backend::ActiveRecord::Job.include(Delayed::JobGroups::JobExtensions)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Delayed
4
4
  module JobGroups
5
- VERSION = '0.6.0'
5
+ VERSION = '0.6.2'
6
6
  end
7
7
  end
@@ -11,6 +11,12 @@ require 'delayed/job_groups/plugin'
11
11
  require 'delayed/job_groups/yaml_loader'
12
12
  require 'delayed/job_groups/version'
13
13
 
14
- Delayed::Backend::ActiveRecord::Job.send(:include, Delayed::JobGroups::JobExtensions)
14
+ if defined?(Rails::Railtie)
15
+ # Postpone initialization to railtie for correct order
16
+ require 'delayed/job_groups/railtie'
17
+ else
18
+ # Do the same as in the railtie
19
+ Delayed::Backend::ActiveRecord::Job.include(Delayed::JobGroups::JobExtensions)
20
+ end
15
21
 
16
22
  Delayed::Worker.plugins << Delayed::JobGroups::Plugin
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ describe "delayed job extensions" do
4
+ it "provides an optional job_group_id" do
5
+ job_group = Delayed::JobGroups::JobGroup.create!
6
+ expect(Delayed::Job.new(job_group_id: job_group.id)).to be_valid
7
+ expect(Delayed::Job.new).to be_valid
8
+ end
9
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: delayed_job_groups_plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Turkel
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-12-17 00:00:00.000000000 Z
12
+ date: 2021-01-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: delayed_job
@@ -254,6 +254,7 @@ files:
254
254
  - lib/delayed/job_groups/job_extensions.rb
255
255
  - lib/delayed/job_groups/job_group.rb
256
256
  - lib/delayed/job_groups/plugin.rb
257
+ - lib/delayed/job_groups/railtie.rb
257
258
  - lib/delayed/job_groups/version.rb
258
259
  - lib/delayed/job_groups/yaml_loader.rb
259
260
  - lib/delayed_job_groups_plugin.rb
@@ -261,6 +262,7 @@ files:
261
262
  - lib/generators/delayed_job_groups_plugin/templates/migration.erb
262
263
  - spec/db/database.yml
263
264
  - spec/db/schema.rb
265
+ - spec/delayed/job_groups/job_extensions_spec.rb
264
266
  - spec/delayed/job_groups/job_group_spec.rb
265
267
  - spec/delayed/job_groups/plugin_spec.rb
266
268
  - spec/delayed/job_groups/yaml_loader_spec.rb
@@ -296,5 +298,6 @@ test_files:
296
298
  - spec/delayed/job_groups/plugin_spec.rb
297
299
  - spec/delayed/job_groups/job_group_spec.rb
298
300
  - spec/delayed/job_groups/yaml_loader_spec.rb
301
+ - spec/delayed/job_groups/job_extensions_spec.rb
299
302
  - spec/db/schema.rb
300
303
  - spec/db/database.yml