From dfb2cdd485fdb6eb14f7cf7cc5d9be980cf55bb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibaut=20Barre=CC=80re?= Date: Sat, 7 Jan 2012 21:20:32 +0100 Subject: [PATCH] Bring back compatibility with old ActiveSupport versions without TimeWithZone defined --- lib/awesome_print/ext/active_support.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/awesome_print/ext/active_support.rb b/lib/awesome_print/ext/active_support.rb index 7cce1f7..b216324 100644 --- a/lib/awesome_print/ext/active_support.rb +++ b/lib/awesome_print/ext/active_support.rb @@ -14,7 +14,7 @@ module AwesomePrint def cast_with_active_support(object, type) cast = cast_without_active_support(object, type) if defined?(::ActiveSupport) && defined?(::HashWithIndifferentAccess) - if object.is_a?(::ActiveSupport::TimeWithZone) || object.is_a?(::Date) + if (defined?(::ActiveSupport::TimeWithZone) && object.is_a?(::ActiveSupport::TimeWithZone)) || object.is_a?(::Date) cast = :active_support_time elsif object.is_a?(::HashWithIndifferentAccess) cast = :hash_with_indifferent_access