Created
November 13, 2009 15:43
-
-
Save kakra/233905 to your computer and use it in GitHub Desktop.
patch DelayedJob in the case no default_timezone is defined
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Delayed | |
class Job < ActiveRecord::Base | |
def self.db_time_now | |
(ActiveRecord::Base.default_timezone == :utc) ? Time.now.utc : Time.zone.now | |
rescue NoMethodError | |
Time.now | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment