Skip to content

Commit

Permalink
Fixing problem with no Time.zone
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtimberlake committed May 12, 2010
1 parent 4eaa2af commit 19d4c50
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 44 deletions.
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
1.8.5
1.8.4.2
41 changes: 0 additions & 41 deletions delayed_job.gemspec

This file was deleted.

4 changes: 2 additions & 2 deletions lib/delayed/job.rb
Expand Up @@ -110,7 +110,7 @@ def self.enqueue(*args, &block)
unless object.respond_to?(:perform) || block_given?
raise ArgumentError, 'Cannot enqueue items which do not respond to perform'
end

options = args.first || {}
options[:priority] ||= 0
options[:payload_object] = object
Expand Down Expand Up @@ -258,7 +258,7 @@ def attempt_to_load(klass)
# Note: This does not ping the DB to get the time, so all your clients
# must have syncronized clocks.
def self.db_time_now
(ActiveRecord::Base.default_timezone == :utc) ? Time.now.utc : Time.zone.now
(ActiveRecord::Base.default_timezone == :utc) ? Time.now.utc : (Time.zone ? Time.zone.now : Time.now)
end

protected
Expand Down

0 comments on commit 19d4c50

Please sign in to comment.