Skip to content

Loading…

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

Open
wants to merge 1 commit into from

1 participant

@singjie

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 with 3 additions and 1 deletion.
  1. +3 −1 lib/delayed/job.rb
View
4 lib/delayed/job.rb
@@ -30,6 +30,8 @@ class Job < ActiveRecord::Base
cattr_accessor :min_priority, :max_priority
self.min_priority = nil
self.max_priority = nil
+
+ before_save :update_run_at
# When a worker is exiting, make sure we don't have any locked jobs.
def self.clear_locks!
@@ -254,7 +256,7 @@ def self.db_time_now
protected
- def before_save
+ def update_run_at
self.run_at ||= self.class.db_time_now
end
Something went wrong with that request. Please try again.