From b9be374ddd2142ca53da3c235e35ccbb70c66842 Mon Sep 17 00:00:00 2001 From: Geoff Buesing Date: Sun, 10 Feb 2008 19:02:30 +0000 Subject: Time#zone=, #in_time_zone and #change_time_zone accept a Duration git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8850 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/core_ext/time/zones.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/core_ext/time/zones.rb') diff --git a/activesupport/lib/active_support/core_ext/time/zones.rb b/activesupport/lib/active_support/core_ext/time/zones.rb index 18af28edc8..1fab89be48 100644 --- a/activesupport/lib/active_support/core_ext/time/zones.rb +++ b/activesupport/lib/active_support/core_ext/time/zones.rb @@ -38,7 +38,8 @@ module ActiveSupport #:nodoc: private def get_zone(time_zone) - ::String === time_zone || ::Numeric === time_zone ? TimeZone[time_zone] : time_zone + return time_zone if time_zone.nil? || time_zone.respond_to?(:period_for_local) + TimeZone[time_zone] end end -- cgit v1.2.3