[Ovirt-devel] [PATCH] fix for 468378: details pane for disabled hosts.

Scott Seago sseago at redhat.com
Tue Jan 20 18:37:36 UTC 2009


A prior refactoring removed the 'do' and 'end' around an association method -- this patch restores it.

Signed-off-by: Scott Seago <sseago at redhat.com>
---
 src/app/models/host.rb |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/app/models/host.rb b/src/app/models/host.rb
index 813bc1d..e4ae5d6 100644
--- a/src/app/models/host.rb
+++ b/src/app/models/host.rb
@@ -35,11 +35,12 @@ class Host < ActiveRecord::Base
   has_many :cpus,     :dependent => :destroy
   has_many :nics,     :dependent => :destroy
   has_many :bondings, :dependent => :destroy
-  has_many :vms,      :dependent => :nullify
-
+  has_many :vms,      :dependent => :nullify do
     def consuming_resources
       find(:all, :conditions=>{:state=>Vm::RUNNING_STATES})
     end
+  end
+
   has_many :tasks, :as => :task_target, :dependent => :destroy, :order => "id ASC" do
     def queued
       find(:all, :conditions=>{:state=>Task::STATE_QUEUED})
-- 
1.6.0.6




More information about the ovirt-devel mailing list