From: Jan Provaznik jprovazn@redhat.com
--- src/app/controllers/application_controller.rb | 4 ++-- src/app/controllers/deployments_controller.rb | 4 ++-- src/app/controllers/instances_controller.rb | 6 +++--- src/app/controllers/providers_controller.rb | 2 +- src/app/controllers/realm_mappings_controller.rb | 2 +- src/app/views/layouts/_footer.haml | 2 +- src/app/views/layouts/_header.haml | 6 +++--- src/app/views/layouts/_masthead.haml | 2 +- .../controllers/user_sessions_controller_spec.rb | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/src/app/controllers/application_controller.rb b/src/app/controllers/application_controller.rb index d2773aa..7f0b68c 100644 --- a/src/app/controllers/application_controller.rb +++ b/src/app/controllers/application_controller.rb @@ -99,8 +99,8 @@ class ApplicationController < ActionController::Base
def get_nav_items if current_user.present? - @providers = Provider.list_for_user(@current_user, Privilege::VIEW) - @pools = Pool.list_for_user(@current_user, Privilege::VIEW) + @providers = Provider.list_for_user(current_user, Privilege::VIEW) + @pools = Pool.list_for_user(current_user, Privilege::VIEW) end end
diff --git a/src/app/controllers/deployments_controller.rb b/src/app/controllers/deployments_controller.rb index bab4670..988e174 100644 --- a/src/app/controllers/deployments_controller.rb +++ b/src/app/controllers/deployments_controller.rb @@ -228,7 +228,7 @@ class DeploymentsController < ApplicationController
# not sure if task is used as everything goes through condor #permissons check here - @task = instance.queue_action(@current_user, 'stop') + @task = instance.queue_action(current_user, 'stop') unless @task raise ActionError.new("stop cannot be performed on this instance.") end @@ -289,7 +289,7 @@ class DeploymentsController < ApplicationController end
def init_new_deployment_attrs - @pools = Pool.list_for_user(@current_user, Privilege::CREATE, :target_type => Deployment) + @pools = Pool.list_for_user(current_user, Privilege::CREATE, :target_type => Deployment) @realms = FrontendRealm.all @hardware_profiles = HardwareProfile.all( :include => :architecture, diff --git a/src/app/controllers/instances_controller.rb b/src/app/controllers/instances_controller.rb index 09046a1..240622a 100644 --- a/src/app/controllers/instances_controller.rb +++ b/src/app/controllers/instances_controller.rb @@ -129,7 +129,7 @@ class InstancesController < ApplicationController
# not sure if task is used as everything goes through condor #permissons check here - @task = instance.queue_action(@current_user, 'stop') + @task = instance.queue_action(current_user, 'stop') unless @task raise ActionError.new("stop cannot be performed on this instance.") end @@ -163,7 +163,7 @@ class InstancesController < ApplicationController end
def init_new_instance_attrs - @pools = Pool.list_for_user(@current_user, Privilege::CREATE, {:target_type => Instance,:conditions=>{ :enabled => true}}) + @pools = Pool.list_for_user(current_user, Privilege::CREATE, {:target_type => Instance,:conditions=>{ :enabled => true}}) @realms = FrontendRealm.all @hardware_profiles = HardwareProfile.all( :include => :architecture, @@ -183,7 +183,7 @@ class InstancesController < ApplicationController {:name => 'CREATED BY', :sort_attr => 'users.last_name'}, ]
- @pools = Pool.list_for_user(@current_user, Privilege::CREATE, :target_type => Instance) + @pools = Pool.list_for_user(current_user, Privilege::CREATE, :target_type => Instance) end
def load_instances diff --git a/src/app/controllers/providers_controller.rb b/src/app/controllers/providers_controller.rb index 2971e21..3e1bb5d 100644 --- a/src/app/controllers/providers_controller.rb +++ b/src/app/controllers/providers_controller.rb @@ -149,6 +149,6 @@ class ProvidersController < ApplicationController end
def load_providers - @providers = Provider.list_for_user(@current_user, Privilege::VIEW) + @providers = Provider.list_for_user(current_user, Privilege::VIEW) end end diff --git a/src/app/controllers/realm_mappings_controller.rb b/src/app/controllers/realm_mappings_controller.rb index 18ddce2..2435079 100644 --- a/src/app/controllers/realm_mappings_controller.rb +++ b/src/app/controllers/realm_mappings_controller.rb @@ -39,6 +39,6 @@ class RealmMappingsController < ApplicationController protected
def load_backend_targets - @backend_targets = @realm_target.realm_or_provider_type == 'Realm' ? Realm.all : Provider.list_for_user(@current_user, Privilege::VIEW) + @backend_targets = @realm_target.realm_or_provider_type == 'Realm' ? Realm.all : Provider.list_for_user(current_user, Privilege::VIEW) end end diff --git a/src/app/views/layouts/_footer.haml b/src/app/views/layouts/_footer.haml index c1e66c9..1ddc7a7 100644 --- a/src/app/views/layouts/_footer.haml +++ b/src/app/views/layouts/_footer.haml @@ -1,5 +1,5 @@ %ul.container_16 - - unless @current_user.nil? + - unless current_user.nil? %li = link_to t(:logout), logout_url %li Copyright © 2010-2011 Red Hat, Inc. diff --git a/src/app/views/layouts/_header.haml b/src/app/views/layouts/_header.haml index d853ad2..4d3e7bc 100644 --- a/src/app/views/layouts/_header.haml +++ b/src/app/views/layouts/_header.haml @@ -1,6 +1,6 @@ %h1 Red Hat Cloud Engine -- unless @current_user.nil? +- unless current_user.nil? %ul / FIXME: commented out because these links don't do anything yet @@ -12,9 +12,9 @@ = t(:configure)
%li.hello - - link_to edit_user_path(@current_user) do + - link_to edit_user_path(current_user) do = t(:hello) + " " %b - = "#{@current_user.first_name} #{@current_user.last_name}" + = "#{current_user.first_name} #{current_user.last_name}" %li.logout = link_to t(:logout), logout_url diff --git a/src/app/views/layouts/_masthead.haml b/src/app/views/layouts/_masthead.haml index 308b22a..60fbc2f 100644 --- a/src/app/views/layouts/_masthead.haml +++ b/src/app/views/layouts/_masthead.haml @@ -4,7 +4,7 @@ %ul %li.account %span.name.label.strong.small-caps - = "#{@current_user.first_name} #{@current_user.last_name}" if @current_user.present? + = "#{current_user.first_name} #{current_user.last_name}" if current_user.present? %a.button.pill.user-dropdown{:href => '#'} %span#user-menu{ :class => javascript? ? 'js' : 'nojs' } = link_to "My Account", account_path diff --git a/src/spec/controllers/user_sessions_controller_spec.rb b/src/spec/controllers/user_sessions_controller_spec.rb index dd55488..64e6eee 100644 --- a/src/spec/controllers/user_sessions_controller_spec.rb +++ b/src/spec/controllers/user_sessions_controller_spec.rb @@ -11,7 +11,7 @@ describe UserSessionsController do it "should call new method" do {:get => 'login'}.should route_to(:controller => 'user_sessions', :action => 'new') get :new - @current_user.should == nil + current_user.should == nil UserSession.find.should == nil response.should be_success end