From 73bddd12a4311debf264e8beb226b296ef568dd6 Mon Sep 17 00:00:00 2001 From: Andrew White Date: Sun, 1 Jul 2012 08:48:40 +0100 Subject: 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. --- activesupport/lib/active_support/values/time_zone.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'activesupport/lib/active_support/values') diff --git a/activesupport/lib/active_support/values/time_zone.rb b/activesupport/lib/active_support/values/time_zone.rb index 28bc06f103..cc3e6a4bf3 100644 --- a/activesupport/lib/active_support/values/time_zone.rb +++ b/activesupport/lib/active_support/values/time_zone.rb @@ -254,8 +254,7 @@ module ActiveSupport # 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. -- cgit v1.2.3