Changeset 4909
- Timestamp:
- 09/02/06 21:00:09 (2 years ago)
- Files:
-
- trunk/activerecord/CHANGELOG (modified) (1 diff)
- trunk/activerecord/lib/active_record/xml_serialization.rb (modified) (1 diff)
- trunk/activerecord/test/base_test.rb (modified) (1 diff)
- trunk/activerecord/test/fixtures/topic.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activerecord/CHANGELOG
r4898 r4909 1 1 *SVN* 2 3 * to_xml: the :methods option works on arrays of records. #5845 [Josh Starcher] 2 4 3 5 * Deprecation: update docs. #5998 [jakob@mentalized.net, Kevin Clark] trunk/activerecord/lib/active_record/xml_serialization.rb
r4862 r4909 161 161 162 162 def serializable_method_attributes 163 Array(options .delete(:methods)).collect { |name| MethodAttribute.new(name.to_s, @record) }163 Array(options[:methods]).collect { |name| MethodAttribute.new(name.to_s, @record) } 164 164 end 165 165 trunk/activerecord/test/base_test.rb
r4819 r4909 1341 1341 assert xml.include?(%(<replies><reply>)) 1342 1342 end 1343 1344 def test_array_to_xml_including_methods 1345 xml = [ topics(:first), topics(:second) ].to_xml(:indent => 0, :skip_instruct => true, :methods => [ :topic_id ]) 1346 assert xml.include?(%(<topic-id type="integer">#{topics(:first).topic_id}</topic-id>)) 1347 assert xml.include?(%(<topic-id type="integer">#{topics(:second).topic_id}</topic-id>)) 1348 end 1343 1349 1344 1350 def test_array_to_xml_including_has_one_association trunk/activerecord/test/fixtures/topic.rb
r3941 r4909 10 10 end 11 11 12 # trivial method for testing Array#to_xml with :methods 13 def topic_id 14 id 15 end 16 12 17 protected 13 18 def default_written_on