diff options
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb b/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb index 44a679a550..c1c3987cf5 100644 --- a/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb +++ b/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb @@ -10,7 +10,17 @@ module ActiveRecord def type_cast(value) value = @column.type_cast(value) - value.acts_like?(:time) ? value.in_time_zone : value + convert_value_to_time_zone(value) + end + + def convert_value_to_time_zone(value) + if value.is_a?(Array) + value.map { |v| convert_value_to_time_zone(v) } + elsif value.acts_like?(:time) + value.in_time_zone + else + value + end end end |