Permalink
Browse files

before_* after_* methods are deprecated in Rails3.0 and removed in Ra…

…ils3.1
  • Loading branch information...
1 parent 719b628 commit 42e9d1525812f4c18759bb745f101abff5d59551 @singjie singjie committed Aug 17, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/delayed/job.rb
View
@@ -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

0 comments on commit 42e9d15

Please sign in to comment.