From: David Lutterkort <[email protected]>

---
 server/lib/cimi/models/collection.rb |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/server/lib/cimi/models/collection.rb 
b/server/lib/cimi/models/collection.rb
index 48c9ccb..49c36ff 100644
--- a/server/lib/cimi/models/collection.rb
+++ b/server/lib/cimi/models/collection.rb
@@ -115,9 +115,16 @@ module CIMI::Model
         entries = find(:all, context)
         desc = "#{self.name.split("::").last} Collection for the 
#{context.driver.name.capitalize} driver"
         id = context.send("#{collection_class.entry_name}_url")
+        ops = []
+        create = "create_#{collection_class.entry_name.to_s.singularize}_url"
+        if context.respond_to?(create)
+          url = context.send(create)
+          ops << { :rel => "add", :href => url }
+        end
         collection_class.new(:id => id, :name => 'default',
                              :count => entries.size,
                              :entries => entries,
+                             :operations => ops,
                              :description => desc)
       end
     end
-- 
1.7.7.6

Reply via email to