[
https://issues.apache.org/jira/browse/DTACLOUD-321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13455737#comment-13455737
]
Marios Andreou commented on DTACLOUD-321:
-----------------------------------------
initial reaction is - its because we no longer use the DSL to add the Foo items
for the FooCollection... like before we had for example:
class FooCollection
array :foo do
but now we directly add the foo array to the FooCollection (via the
"add_collection_member_array" in schema.rb which you syntax_sugarized as "<<"
in base.rb ) - so I guess we need to extend this method of adding Foo items to
also define the methods? Make sense?
Terms and conditions apply, caveat emptor etc... this is just the first thing I
can think of.
> CIMI models does not respond to methods correctly
> -------------------------------------------------
>
> Key: DTACLOUD-321
> URL: https://issues.apache.org/jira/browse/DTACLOUD-321
> Project: DeltaCloud
> Issue Type: Bug
> Reporter: Michal Fojtik
>
> Sorry for weird bug title but I can't figure out how to better describe this
> behaviour ;-).
> I'm fixing CIMI client and I got a weird error when I tried to access
> MachineImage collection:
> NoMethodError - undefined method `machine_images' for
> #<CIMI::Model::MachineImageCollection:0x007ff6cacbc938>:
>
> /Users/mfojtik/code/core/clients/cimi/lib/entities/machine_image.rb:27:in
> `block in <class:MachineImage>'
> It seems like the MachineImageCollection object was created with all values
> set:
> #<CIMI::Model::MachineImageCollection:0x007ffd71327898
> @attribute_values={:id=>"http://localhost:3001/cimi/machine_images",
> :name=>"default", :description=>"Mock MachineImageCollection",
> :created=>"2012-09-14 13:26:59 +0200", :property=>{}, :count=>"4",
> :machine_images=>[#<struct
> id="http://localhost:3001/cimi/machine_images/img2", name="img2",
> description="Fedora 10", created="2012-09-14 13:26:59 +0200", property={},
> image_location=#<struct href="mock://img2">, image_data=nil, operations=[]>,
> #<struct id="http://localhost:3001/cimi/machine_images/img1", name="img1",
> description="Fedora 10", created="2012-09-14 13:26:59 +0200", property={},
> image_location=#<struct href="mock://img1">, image_data=nil, operations=[]>,
> #<struct id="http://localhost:3001/cimi/machine_images/img3", name="img3",
> description="JBoss", created="2012-09-14 13:26:59 +0200", property={},
> image_location=#<struct href="mock://img3">, image_data=nil, operations=[]>,
> #<struct id="http://localhost:3001/cimi/machine_images/img1-test",
> name="img1-test", description="Test1", created="2012-09-14 13:26:59 +0200",
> property={}, image_location=#<struct href="mock://img1-test">,
> image_data=nil, operations=[]>]}>
> However, when I call '.machine_images' on that object I got NoMethodError. I
> dunno If I'm doing something wrong or this is a bug :-)
> Also I can see the ':machine_images' attribute in MachineImagesCollection
> model.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira