aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2012-07-01 08:48:40 +0100
committerAndrew White <andyw@pixeltrix.co.uk>2012-07-01 08:48:40 +0100
commit73bddd12a4311debf264e8beb226b296ef568dd6 (patch)
treea7fb61b3d2112eb3c1689c847671d958dc7c7719
parentc685d12c19f953768ee445ab29faeb4a1be54535 (diff)
downloadrails-73bddd12a4311debf264e8beb226b296ef568dd6.tar.gz
rails-73bddd12a4311debf264e8beb226b296ef568dd6.tar.bz2
rails-73bddd12a4311debf264e8beb226b296ef568dd6.zip
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.
-rw-r--r--activesupport/lib/active_support/values/time_zone.rb3
1 files changed, 1 insertions, 2 deletions
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.