Skip to content

Instantly share code, notes, and snippets.

@kakra
Created November 13, 2009 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kakra/233905 to your computer and use it in GitHub Desktop.
Save kakra/233905 to your computer and use it in GitHub Desktop.
patch DelayedJob in the case no default_timezone is defined
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