Skip to content
This repository

Fixed jobs not executing in Rails3.1rc5 due to run_at = nil #46

Open
wants to merge 1 commit into from

1 participant

Sing Jie Lee
Sing Jie Lee

before_* after_* methods are deprecated in Rails3.0 and removed in Rails3.1rc5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Aug 17, 2011
Sing Jie Lee before_* after_* methods are deprecated in Rails3.0 and removed in Ra…
…ils3.1
42e9d15
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 3 additions and 1 deletion. Show diff stats Hide diff stats

  1. 4  lib/delayed/job.rb
4  lib/delayed/job.rb
@@ -30,6 +30,8 @@ class Job < ActiveRecord::Base
30 30
     cattr_accessor :min_priority, :max_priority
31 31
     self.min_priority = nil
32 32
     self.max_priority = nil
  33
+    
  34
+    before_save :update_run_at
33 35
 
34 36
     # When a worker is exiting, make sure we don't have any locked jobs.
35 37
     def self.clear_locks!
@@ -254,7 +256,7 @@ def self.db_time_now
254 256
 
255 257
   protected
256 258
 
257  
-    def before_save
  259
+    def update_run_at
258 260
       self.run_at ||= self.class.db_time_now
259 261
     end
260 262
 
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.