mirror of
https://github.com/awesome-print/awesome_print
synced 2023-03-27 23:22:34 -04:00
Bring back compatibility with old ActiveSupport versions without TimeWithZone defined
(cherry picked from commit dfb2cdd485
)
This commit is contained in:
parent
23b9ad9122
commit
2960784d81
1 changed files with 1 additions and 1 deletions
|
@ -14,7 +14,7 @@ module AwesomePrint
|
||||||
def cast_with_active_support(object, type)
|
def cast_with_active_support(object, type)
|
||||||
cast = cast_without_active_support(object, type)
|
cast = cast_without_active_support(object, type)
|
||||||
if defined?(::ActiveSupport) && defined?(::HashWithIndifferentAccess)
|
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
|
cast = :active_support_time
|
||||||
elsif object.is_a?(::HashWithIndifferentAccess)
|
elsif object.is_a?(::HashWithIndifferentAccess)
|
||||||
cast = :hash_with_indifferent_access
|
cast = :hash_with_indifferent_access
|
||||||
|
|
Loading…
Reference in a new issue