aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/core_ext')
-rw-r--r--activesupport/lib/active_support/core_ext/time/zones.rb3
1 files changed, 2 insertions, 1 deletions
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