delayed_job_extras 0.13.0 → 0.13.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,10 +1,10 @@
|
|
1
1
|
# Rails 3 style validation:
|
2
2
|
class UniqueDJValidator < ActiveModel::Validator
|
3
|
-
def validate()
|
3
|
+
def validate(record)
|
4
4
|
|
5
5
|
if record.payload_object.respond_to?(:unique?) && record.new_record?
|
6
6
|
if record.payload_object.unique?
|
7
|
-
if Delayed::Job.
|
7
|
+
if Delayed::Job.where(:worker_class_name => 'self.worker_class_name', :finished_at => nil).count > 0
|
8
8
|
record.errors.add_to_base("Only one #{record.worker_class_name} can be queued at a time!")
|
9
9
|
end
|
10
10
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 13
|
8
|
-
-
|
9
|
-
version: 0.13.
|
8
|
+
- 1
|
9
|
+
version: 0.13.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- markbates
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-05-
|
17
|
+
date: 2010-05-16 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|