Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 5210

Show
Ignore:
Timestamp:
09/29/06 22:45:58 (3 years ago)
Author:
bitsweat
Message:

Use class name as XML_TYPE_NAMES key.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activerecord/lib/active_record/xml_serialization.rb

    r5170 r5210  
    298298        end 
    299299    end 
    300    
     300 
    301301    class MethodAttribute < Attribute #:nodoc: 
    302302      protected 
    303303        def compute_type 
    304           Hash::XML_TYPE_NAMES[@record.send(name).class] || :string 
     304          Hash::XML_TYPE_NAMES[@record.send(name).class.name] || :string 
    305305        end 
    306306    end 
  • trunk/activerecord/test/base_test.rb

    r5192 r5210  
    13411341  def test_array_to_xml_including_methods 
    13421342    xml = [ topics(:first), topics(:second) ].to_xml(:indent => 0, :skip_instruct => true, :methods => [ :topic_id ]) 
    1343     assert xml.include?(%(<topic-id type="integer">#{topics(:first).topic_id}</topic-id>)) 
    1344     assert xml.include?(%(<topic-id type="integer">#{topics(:second).topic_id}</topic-id>)) 
     1343    assert xml.include?(%(<topic-id type="integer">#{topics(:first).topic_id}</topic-id>)), xml 
     1344    assert xml.include?(%(<topic-id type="integer">#{topics(:second).topic_id}</topic-id>)), xml 
    13451345  end 
    13461346