From: Jan Provaznik <jprovazn(a)redhat.com>
---
src/app/controllers/instances_controller.rb | 1 +
src/app/controllers/pools_controller.rb | 2 +-
src/app/models/pool.rb | 4 ----
src/app/views/instances/configure.haml | 2 +-
src/spec/controllers/pools_controller_spec.rb | 10 ----------
5 files changed, 3 insertions(+), 16 deletions(-)
diff --git a/src/app/controllers/instances_controller.rb
b/src/app/controllers/instances_controller.rb
index 5e68b8e..dd20c85 100644
--- a/src/app/controllers/instances_controller.rb
+++ b/src/app/controllers/instances_controller.rb
@@ -85,6 +85,7 @@ class InstancesController < ApplicationController
@hardware_profiles = HardwareProfile.find(:all, :include => :architecture,
:conditions => {:provider_id => nil,
'hardware_profile_properties.value' =>
@instance.template.architecture})
+ @realms = FrontendRealm.all
end
def create
diff --git a/src/app/controllers/pools_controller.rb
b/src/app/controllers/pools_controller.rb
index 47cdc77..e7d4cae 100644
--- a/src/app/controllers/pools_controller.rb
+++ b/src/app/controllers/pools_controller.rb
@@ -79,7 +79,7 @@ class PoolsController < ApplicationController
def realms
@pool = Pool.find(params[:id])
- @realm_names = @pool.realms
+ @realm_names = FrontendRealm.all
require_privilege(Privilege::POOL_VIEW,@pool)
end
diff --git a/src/app/models/pool.rb b/src/app/models/pool.rb
index c76cb00..89e7f36 100644
--- a/src/app/models/pool.rb
+++ b/src/app/models/pool.rb
@@ -57,8 +57,4 @@ class Pool < ActiveRecord::Base
HardwareProfile.find(:all, :conditions => {:provider_id => nil})
end
- def realms
- Realm.find(:all, :conditions => { :provider_id => nil })
- end
-
end
diff --git a/src/app/views/instances/configure.haml
b/src/app/views/instances/configure.haml
index 809c044..e22ff66 100644
--- a/src/app/views/instances/configure.haml
+++ b/src/app/views/instances/configure.haml
@@ -17,7 +17,7 @@
= select :instance, :hardware_profile_id, @hardware_profiles.map {|p| [ p.name,
p.id ]}, { :include_blank => false }
%li
= label :instance, :realm
- = select :instance, :realm_id, @instance.pool.realms.map {|r| [ r.name, r.id ]}, {
:include_blank => true }
+ = select :instance, :realm_id, @realms.map {|r| [ r.name, r.id ]}, { :include_blank
=> true }
= submit_tag 'Cancel', :name => 'cancel'
= submit_tag 'Launch', :name => 'launch'
diff --git a/src/spec/controllers/pools_controller_spec.rb
b/src/spec/controllers/pools_controller_spec.rb
index c9fcc82..17f1ccf 100644
--- a/src/spec/controllers/pools_controller_spec.rb
+++ b/src/spec/controllers/pools_controller_spec.rb
@@ -39,14 +39,4 @@ describe PoolsController do
response.should render_template("hardware_profiles")
end
- it "should provide ui to view realms" do
- UserSession.create(@admin)
- pool = Factory :tpool
-
- get :realms, :id => pool.id
- response.should be_success
- assigns[:realm_names].size.should == pool.realms.size
- response.should render_template("realms")
- end
-
end
--
1.7.3.4