navvy 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/navvy/job/active_record.rb +5 -5
  2. metadata +3 -3
@@ -43,8 +43,8 @@ module Navvy
43
43
 
44
44
  def self.next(limit = self.limit)
45
45
  all(
46
- :conditions => [
47
- '`failed_at` IS NULL AND `completed_at` IS NULL AND `run_at` <= ?',
46
+ :conditions => [
47
+ "#{connection.quote_column_name('failed_at')} IS NULL AND #{connection.quote_column_name('completed_at')} IS NULL AND #{connection.quote_column_name('run_at')} <= ?",
48
48
  Time.now
49
49
  ],
50
50
  :limit => limit,
@@ -62,12 +62,12 @@ module Navvy
62
62
  def self.cleanup
63
63
  if keep.is_a? Fixnum
64
64
  delete_all([
65
- '`completed_at` <= ?',
65
+ "#{connection.quote_column_name('completed_at')} <= ?",
66
66
  keep.ago
67
67
  ])
68
68
  else
69
69
  delete_all(
70
- '`completed_at` IS NOT NULL'
70
+ "#{connection.quote_column_name('completed_at')} IS NOT NULL"
71
71
  ) unless keep?
72
72
  end
73
73
  end
@@ -127,7 +127,7 @@ module Navvy
127
127
  def times_failed
128
128
  i = parent_id || id
129
129
  self.class.count(
130
- :conditions => "(`id` = '#{i}' OR `parent_id` = '#{i}') AND `failed_at` IS NOT NULL"
130
+ :conditions => "(#{connection.quote_column_name('id')} = '#{i}' OR #{connection.quote_column_name('parent_id')} = '#{i}') AND #{connection.quote_column_name('failed_at')} IS NOT NULL"
131
131
  )
132
132
  end
133
133
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 0
9
- version: 0.3.0
8
+ - 1
9
+ version: 0.3.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jeff Kreeftmeijer
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-06-28 00:00:00 +02:00
17
+ date: 2010-07-09 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency