This project is archived and is in readonly mode.

#1011 ✓resolved
adam.groves (at gmail)

Re-add to_xml to ActiveResource

Reported by adam.groves (at gmail) | September 10th, 2008 @ 11:25 AM

The method #encode doesn't work on an instance of ActiveResource having other ActiveResource instances in it's attributes.

Example:


  @mum = Parent.find(1)
  @mum.attributes = {"name" => "Mum","children"=> [#<Parent::Child:0x405e8cc ...>,#<Parent::Child:0x405e8cc ...>]}
  @mum.name = "Mom"
  @mum.save
  # => RuntimeError Exception: Not all elements respond to to_xml

Solution:

re-add #to_xml to ActiveResource::Base

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Referenced by

Pages