Permalink
Browse files

Use the safe conversion code introduced in earlier commit. References #…

…10068 [gbuesing]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8077 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 47576a6 commit 7e6bb82f44782deeedc81886b6f2abd7f69a982c @NZKoz NZKoz committed Nov 5, 2007
View
2 activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
@@ -173,7 +173,7 @@ def new_time(year, mon, mday, hour, min, sec, microsec)
Time.send(Base.default_timezone, year, mon, mday, hour, min, sec, microsec)
# Over/underflow to DateTime
rescue ArgumentError, TypeError
- zone_offset = if Base.default_timezone == :local then DateTime.now.offset else 0 end
+ zone_offset = Base.default_timezone == :local ? DateTime.local_offset : 0
# Append zero calendar reform start to account for dates skipped by calendar reform
DateTime.new(year, mon, mday, hour, min, sec, zone_offset, 0) rescue nil
end

0 comments on commit 7e6bb82

Please sign in to comment.