sqewer 6.0.5 → 6.0.6

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
  SHA1:
3
- metadata.gz: 767a22e397deea673d08fa54d539b187a0063c79
4
- data.tar.gz: ac6fb77bc19292447dde3c6e0a609dd31faa78fd
3
+ metadata.gz: 7a2ea4f82f0df911ffb45032ec714b8d2545780a
4
+ data.tar.gz: 3bde7fb9fb85a51a80ab566768a3eafd23c2825d
5
5
  SHA512:
6
- metadata.gz: '027792d46b88babaa41e0429387b68754f0341e24b5846c15c8c3edab024ec4874e905bc55ecf438ed63f84fb1ddba75f047186e4299d5308853a008c3f8d941'
7
- data.tar.gz: 6095e328ffc6c58cb3c0c480ca4c2cb3388ae1f94b1100f4533348001815c1e0635e8f8fd2bf01b760924326f33d6efbe92704766043101798854edbadbeeb16
6
+ metadata.gz: 592ba8e297da9d9e7a07a35cbb0521cd6f932e376709933560eec4ea609482f0ca00956612ab839ca4df83e2bec7dd35fb3612c856fb2ee0fc1c0e0d92ba9a9d
7
+ data.tar.gz: 56005129f98d24234235de265cf1216433392276018011276f4872fa742ab80b5c62aea82b227881a4aca7e65fe56d24f2e424fa1afea64e040c7c79948b2854
@@ -1,3 +1,7 @@
1
+ ### 6.0.6
2
+ - Make sure :sqewer ActiveJob adapter parameter works in both Rails 4
3
+ and Rails 5.
4
+
1
5
  ### 6.0.5
2
6
  - Limit ActiveJob compatibility to 4.2 and later, and add Travis test
3
7
  setup for multiple Ruby versions and Rails versions up to and including 5.1
@@ -69,19 +69,35 @@ module ActiveJob
69
69
 
70
70
  end
71
71
 
72
- def enqueue(active_job) #:nodoc:
72
+ def self.enqueue(active_job) #:nodoc:
73
73
  wrapped_job = Performable.from_active_job(active_job)
74
74
 
75
75
  Sqewer.submit!(wrapped_job)
76
76
  end
77
77
 
78
- def enqueue_at(active_job, timestamp) #:nodoc:
78
+ def self.enqueue_at(active_job, timestamp) #:nodoc:
79
79
  wrapped_job = Performable.from_active_job(active_job)
80
80
 
81
81
  delta_t = (timestamp - Time.now.to_i).to_i
82
82
 
83
83
  Sqewer.submit!(wrapped_job, delay_seconds: delta_t)
84
84
  end
85
+
86
+ # ActiveJob in Rails 4 resolves the symbol value you give it
87
+ # and then tries to call enqueue_* methods directly on what
88
+ # got resolved. In Rails 5, first Rails will call .new on
89
+ # what it resolved from the symbol and _then_ call enqueue
90
+ # and enqueue_at on that what has gotten resolved. This means
91
+ # that we have to expose these methods _both_ as class methods
92
+ # and as instance methods.
93
+ # This can be removed when we stop supporting Rails 4.
94
+ def enqueue_at(*args)
95
+ self.class.enqueue_at(*args)
96
+ end
97
+
98
+ def enqueue(*args)
99
+ self.class.enqueue(*args)
100
+ end
85
101
  end
86
102
  end
87
103
  end
@@ -1,3 +1,3 @@
1
1
  module Sqewer
2
- VERSION = '6.0.5'
2
+ VERSION = '6.0.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqewer
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.5
4
+ version: 6.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julik Tarkhanov