Mohammed Morsi
2008-Jun-03 19:42 UTC
[Ovirt-devel] [PATCH] small fix to get the storage tab working again
Signed-off-by: Mohammed Morsi <mmorsi at redhat.com> --- wui/src/app/models/pool.rb | 2 +- wui/src/app/views/storage/_grid.rhtml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wui/src/app/models/pool.rb b/wui/src/app/models/pool.rb index 58ab062..277b0ce 100644 --- a/wui/src/app/models/pool.rb +++ b/wui/src/app/models/pool.rb @@ -33,7 +33,7 @@ class Pool < ActiveRecord::Base end end - has_many :storage_pools, :dependent => :nullify, :order => "id ASC" do + has_many :storage_pools, :dependent => :nullify, :order => "id ASC", :foreign_key => 'hardware_pool_id' do def total_size_in_gb find(:all).inject(0){ |sum, sp| sum + sp.storage_volumes.total_size_in_gb } end diff --git a/wui/src/app/views/storage/_grid.rhtml b/wui/src/app/views/storage/_grid.rhtml index d44869c..13838a6 100644 --- a/wui/src/app/views/storage/_grid.rhtml +++ b/wui/src/app/views/storage/_grid.rhtml @@ -20,7 +20,7 @@ ], sortname: "ip_addr", sortorder: "asc", - usepager: <%= hwpool.storage_pools.size > storage_per_page ? 'true' : 'false' %>, + usepager: <%= hwpool.storage_volumes.size > storage_per_page ? 'true' : 'false' %>, useRp: true, rp: <%= storage_per_page %>, showTableToggleBtn: true, -- 1.5.4.1 --------------020708090203030306070106--