mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Use class name as XML_TYPE_NAMES key.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5210 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
cb978baafa
commit
25cce68013
2 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue