Permalink
Browse files

Remove rescue clause from ActiveSupport::TimeZone#to_f

Time#at no longer raises an error for large values so we can remove
the rescue clause from ActiveSupport::TimeZone#to_f.
  • Loading branch information...
1 parent c685d12 commit 73bddd12a4311debf264e8beb226b296ef568dd6 @pixeltrix pixeltrix committed Jul 1, 2012
Showing with 1 addition and 2 deletions.
  1. +1 −2 activesupport/lib/active_support/values/time_zone.rb
@@ -254,8 +254,7 @@ def local(*args)
# Time.utc(2000).to_f # => 946684800.0
# Time.zone.at(946684800.0) # => Fri, 31 Dec 1999 14:00:00 HST -10:00
def at(secs)
- utc = Time.at(secs).utc rescue DateTime.civil(1970).since(secs)
- utc.in_time_zone(self)
+ Time.at(secs).utc.in_time_zone(self)
end
# Method for creating new ActiveSupport::TimeWithZone instance in time zone of +self+ from parsed string.

0 comments on commit 73bddd1

Please sign in to comment.