delayed_job_active_record 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/delayed/backend/active_record.rb +2 -1
- metadata +4 -4
@@ -7,7 +7,6 @@ module Delayed
|
|
7
7
|
# Contains the work object as a YAML field.
|
8
8
|
class Job < ::ActiveRecord::Base
|
9
9
|
include Delayed::Backend::Base
|
10
|
-
set_table_name :delayed_jobs
|
11
10
|
|
12
11
|
attr_accessible :priority, :run_at, :queue, :payload_object,
|
13
12
|
:failed_at, :locked_at, :locked_by
|
@@ -19,11 +18,13 @@ module Delayed
|
|
19
18
|
end
|
20
19
|
|
21
20
|
if rails3?
|
21
|
+
self.table_name = 'delayed_jobs'
|
22
22
|
scope :ready_to_run, lambda{|worker_name, max_run_time|
|
23
23
|
where('(run_at <= ? AND (locked_at IS NULL OR locked_at < ?) OR locked_by = ?) AND failed_at IS NULL', db_time_now, db_time_now - max_run_time, worker_name)
|
24
24
|
}
|
25
25
|
scope :by_priority, order('priority ASC, run_at ASC')
|
26
26
|
else
|
27
|
+
set_table_name :delayed_jobs
|
27
28
|
named_scope :ready_to_run, lambda {|worker_name, max_run_time|
|
28
29
|
{ :conditions => ['(run_at <= ? AND (locked_at IS NULL OR locked_at < ?) OR locked_by = ?) AND failed_at IS NULL', db_time_now, db_time_now - max_run_time, worker_name] }
|
29
30
|
}
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: delayed_job_active_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 2
|
10
|
+
version: 0.3.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Matt Griffin
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2012-01-
|
19
|
+
date: 2012-01-30 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|