I'm running into this exact same problem, was there any proper fix yet or
should I just use the workaround
above?
/Oli
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
Comment #3 on issue 5 by nickesk: pyactiveresource does not handle nested
attributes correctly
http://code.google.com/p/pyactiveresource/issues/detail?id=5
The workaround above isn't exactly "correct" as it adds a "value" element
to the
array, which is not the behavior of Ruby ARes, which preserves the array
format.
>> class Slice < ActiveResource::Base
>> self.site = 'http://localhost:3000'
>> end
>> xml = '''...'''
>> site = Site.new(Hash.from_xml(xml)['site'])
>> site.addresses
=> ["173.45.XXX.XXX", "172.21.XXX.XXX"]
However as Mark mentions, to_xml blows up on the address Array
>> site.to_xml
RuntimeError: Not all elements respond to to_xml
...
So this is a problem with the server's XML not being ARes-compliant. PyARes
is a port
of the Ruby implementation, so this should be reported upstream if you feel
this is
really a bug.
Of course that should be "Slice.new(Hash.from_xml(xml)['slice'])" above