diff options
Diffstat (limited to 'activerecord/lib/active_record/serializers')
-rw-r--r-- | activerecord/lib/active_record/serializers/xml_serializer.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/serializers/xml_serializer.rb b/activerecord/lib/active_record/serializers/xml_serializer.rb index 15abf8bac7..0746908131 100644 --- a/activerecord/lib/active_record/serializers/xml_serializer.rb +++ b/activerecord/lib/active_record/serializers/xml_serializer.rb @@ -226,8 +226,14 @@ module ActiveRecord #:nodoc: class Attribute < ActiveModel::Serializers::Xml::Serializer::Attribute #:nodoc: def compute_type - type = @serializable.class.serialized_attributes.has_key?(name) ? - super : @serializable.class.columns_hash[name].type + case + when @serializable.class.serialized_attributes.has_key?(name) + type = super + when @serializable.class.columns_hash.has_key?(name) + type = @serializable.class.columns_hash[name].type + else + type = NilClass + end case type when :text |