This project is archived and is in readonly mode.
Array#to_xml doesn't pick up the root tag name like ActiveRecord#to_xml does
-
David Trasbo
- Assigned user set to Ryan Bigg
The reason why
Array#to_xmluses the genericnameon the class of the first item in the array, is that the method should be able to convert any array to XML, not just an array of Active Record objects.That said, you could ask the first item's class if it responds to
model_name, and just usenameif it doesn't. Patch welcomed. For now this ticket can be marked incomplete. -
Santiago Pastorino
- State changed from new to invalid
I don't know if you're talking about Rails 2-3 or master but as David said Array#to_xml is generic so we can't use model_name