aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorGeoff Petrie & Sean Griffin <g.petrie+sean@gmail.com>2014-06-01 12:00:24 -0600
committerGeoff Petrie <g.petrie@gmail.com>2014-06-01 12:01:29 -0600
commit04919c79d71726aac1732b1d1a305051ceee541b (patch)
tree66ee84235e9831a4c350c063e6cbf02ca3d6c607 /activerecord
parent29cbfa2f33b2d0e2d16a203941998687af7831db (diff)
downloadrails-04919c79d71726aac1732b1d1a305051ceee541b.tar.gz
rails-04919c79d71726aac1732b1d1a305051ceee541b.tar.bz2
rails-04919c79d71726aac1732b1d1a305051ceee541b.zip
Refactor XML serializer to not depend on `serialized_attributes`
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/serializers/xml_serializer.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/serializers/xml_serializer.rb b/activerecord/lib/active_record/serializers/xml_serializer.rb
index 08e8346b49..019fe2218e 100644
--- a/activerecord/lib/active_record/serializers/xml_serializer.rb
+++ b/activerecord/lib/active_record/serializers/xml_serializer.rb
@@ -180,10 +180,12 @@ module ActiveRecord #:nodoc:
class Attribute < ActiveModel::Serializers::Xml::Serializer::Attribute #:nodoc:
def compute_type
klass = @serializable.class
- type = if klass.serialized_attributes.key?(name)
+ column = klass.columns_hash[name] || Type::Value.new
+
+ type = if column.serialized?
super
- elsif klass.columns_hash.key?(name)
- klass.columns_hash[name].type
+ else
+ column.type
end
{ :text => :string,