Hi all,
I'm having problems uploading XML resource instances that contain
plural associations. My configuration contains a "feature" resource
and a "feature-set" resource, where feature belongs to feature-set and
feature-set has many features. Furthermore, to include the associated
feature instances the feature-set model overrides to_xml as follows
def to_xml(options={})
options[:include] = :features
super(options)
end
This enables to upload a feature-set like the one displayed below,
which contains one single feature
<?xml version="1.0" encoding="UTF-8"?>
<record>
<features>
<feature>
<name>Feature</name>
<value>66020</value>
<unit>um</unit>
</feature>
</features>
</record>
When I try to upload the same XML resource extended with multiple
feature nodes, however, AS throws an "undefined method `has_key?' for
Array" exception in attribute_params.find_or_create_for_params (line
145). Apparently, when using a single feature node the encapsulating
array gets removed. When using multiple feature nodes, this array
(which does not implement the has_key? method) causes the exception
mentioned above. Does anyone see what I'm doing wrong, or have an idea
about how to solve this? I already tried to extend the features node
with the type="array" attribute, but that (in turn) causes other
exceptions.
Thanks in advance, and have a nice weekend!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---