This project is archived and is in readonly mode.
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
-
Michael Koziarski September 18th, 2008 @ 10:00 AM
- Tag changed from activeresource, bug, patch, tested to activeresource, bug, patch, tested
- Milestone cleared.
-
Daniel Schierbeck September 23rd, 2008 @ 09:54 PM
Hi rbpandey.
I've had a quick look at your patch, and it seems like you're using tabs instead of two spaces to indent your code. I believe the Rails coding guidelines say that you've got to use the latter style.
Otherwise the patch looks good -- please do fix this and resubmit!
-
Pratik October 7th, 2008 @ 03:36 PM
- Assigned user set to Pratik
- State changed from new to incomplete
Patch is missing the documentation.
Thanks.
-
Cody Fauser October 7th, 2008 @ 05:12 PM
Patch updated with documentation for encoding() and to_json().
-
Repository October 7th, 2008 @ 05:49 PM
- State changed from incomplete to resolved
(from [f2c10f27565318b5efbdc57fb608b2afe9ae445d]) Add ActiveResource::Base#to_xml and ActiveResource::Base#to_json methods. [#1011 state:resolved]
Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...
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>
People watching this ticket
Attachments
Tags
Referenced by
- 450 format patches to support serializing data out in the correct format with correct http request headers per http method type This patch actually seems to have triggered both #1011 an...
- 1011 Re-add to_xml to ActiveResource (from [f2c10f27565318b5efbdc57fb608b2afe9ae445d]) Add Act...