aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-09-29 22:45:58 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-09-29 22:45:58 +0000
commit25cce680134fb97cf2e2b5be03e0043272eaa710 (patch)
treec2d145e38978db49cf518391df5bdc9fddd5ab56 /activerecord
parentcb978baafa68c9bb4f1311df417947249586f47d (diff)
downloadrails-25cce680134fb97cf2e2b5be03e0043272eaa710.tar.gz
rails-25cce680134fb97cf2e2b5be03e0043272eaa710.tar.bz2
rails-25cce680134fb97cf2e2b5be03e0043272eaa710.zip
Use class name as XML_TYPE_NAMES key.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5210 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/xml_serialization.rb4
-rwxr-xr-xactiverecord/test/base_test.rb4
2 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/xml_serialization.rb b/activerecord/lib/active_record/xml_serialization.rb
index 78a3a2193c..7a8167534d 100644
--- a/activerecord/lib/active_record/xml_serialization.rb
+++ b/activerecord/lib/active_record/xml_serialization.rb
@@ -297,11 +297,11 @@ module ActiveRecord #:nodoc:
end
end
end
-
+
class MethodAttribute < Attribute #:nodoc:
protected
def compute_type
- Hash::XML_TYPE_NAMES[@record.send(name).class] || :string
+ Hash::XML_TYPE_NAMES[@record.send(name).class.name] || :string
end
end
end
diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb
index 055f5e8670..9a67426ba2 100755
--- a/activerecord/test/base_test.rb
+++ b/activerecord/test/base_test.rb
@@ -1340,8 +1340,8 @@ class BasicsTest < Test::Unit::TestCase
def test_array_to_xml_including_methods
xml = [ topics(:first), topics(:second) ].to_xml(:indent => 0, :skip_instruct => true, :methods => [ :topic_id ])
- assert xml.include?(%(<topic-id type="integer">#{topics(:first).topic_id}</topic-id>))
- assert xml.include?(%(<topic-id type="integer">#{topics(:second).topic_id}</topic-id>))
+ assert xml.include?(%(<topic-id type="integer">#{topics(:first).topic_id}</topic-id>)), xml
+ assert xml.include?(%(<topic-id type="integer">#{topics(:second).topic_id}</topic-id>)), xml
end
def test_array_to_xml_including_has_one_association