deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 2/2] CIMI: Fix strange issue with Fedora MRI and Datamapper associations
Date Fri, 30 Nov 2012 16:11:31 GMT
From: Michal Fojtik <mfojtik@redhat.com>


Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 server/lib/db/provider.rb | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/server/lib/db/provider.rb b/server/lib/db/provider.rb
index 54fe2d7..25e2ca9 100644
--- a/server/lib/db/provider.rb
+++ b/server/lib/db/provider.rb
@@ -10,6 +10,17 @@ module Deltacloud
 
       has n, :entities
       has n, :machine_templates
+
+      # This is a workaround for strange bug in Fedora MRI:
+      #
+      def machine_templates
+        MachineTemplate.all(:provider_id => self.id)
+      end
+
+      def entities
+        Entity.all(:provider_id => self.id)
+      end
+
     end
 
   end
-- 
1.8.0


Mime
View raw message