From a8faeb28932d1f7c59352ba50b7ada6a63c1aad5 Mon Sep 17 00:00:00 2001 From: Dan Barry Date: Mon, 2 Mar 2009 19:27:44 -0600 Subject: [PATCH] Object#type is deprecated --- .../active_record/serializers/xml_serializer.rb | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/activerecord/lib/active_record/serializers/xml_serializer.rb b/activerecord/lib/active_record/serializers/xml_serializer.rb index 4749823..76e94cb 100644 --- a/activerecord/lib/active_record/serializers/xml_serializer.rb +++ b/activerecord/lib/active_record/serializers/xml_serializer.rb @@ -314,7 +314,12 @@ module ActiveRecord #:nodoc: protected def compute_type - type = @record.class.serialized_attributes.has_key?(name) ? :yaml : @record.class.columns_hash[name].type + if @record.class.serialized_attributes.has_key?(name) + type = :yaml + else + column = @record.class.columns_hash[name] + type = column.is_a?(ConnectionAdapters::Column) ? column.type : column.class + end case type when :text -- 1.6.1