You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by lu...@apache.org on 2013/03/14 19:19:04 UTC

[2/15] git commit: CIMI (schema): properly generate and track embedded collection classes

CIMI (schema): properly generate and track embedded collection classes


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/7f53cad3
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/7f53cad3
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/7f53cad3

Branch: refs/heads/master
Commit: 7f53cad305aa0d093646e830a8a65ebe4f1c8baa
Parents: 793da8e
Author: David Lutterkort <lu...@redhat.com>
Authored: Wed Mar 13 17:01:56 2013 -0700
Committer: David Lutterkort <lu...@redhat.com>
Committed: Wed Mar 13 17:17:27 2013 -0700

----------------------------------------------------------------------
 server/lib/cimi/models/schema.rb |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/7f53cad3/server/lib/cimi/models/schema.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/schema.rb b/server/lib/cimi/models/schema.rb
index b4e9377..9c27c6f 100644
--- a/server/lib/cimi/models/schema.rb
+++ b/server/lib/cimi/models/schema.rb
@@ -302,7 +302,10 @@ class CIMI::Model::Schema
         raise "Specify the class of collection entries using :class"
       end
       params[:embedded] = true
-      @collection_class = CIMI::Model::Collection.generate(opts[:class], params)
+      unless opts[:class].collection_class
+        opts[:class].collection_class = CIMI::Model::Collection.generate(opts[:class], params)
+      end
+      @collection_class = opts[:class].collection_class
     end
 
     def from_xml(xml, model)
@@ -466,7 +469,7 @@ class CIMI::Model::Schema
     end
 
     def collection(name, opts={})
-      opts[:scope] = self.class
+      opts[:scope] = self
       add_attributes!([name, opts], Collection)
     end
   end