[PATCH conductor 03/11] ensure param processed by ids_list is an array
Mo Morsi
mmorsi at redhat.com
Thu Jun 21 20:51:51 UTC 2012
---
src/app/controllers/application_controller.rb | 1 +
src/app/controllers/pools_controller.rb | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/app/controllers/application_controller.rb b/src/app/controllers/application_controller.rb
index 6b94efb..1907d23 100644
--- a/src/app/controllers/application_controller.rb
+++ b/src/app/controllers/application_controller.rb
@@ -122,6 +122,7 @@ class ApplicationController < ActionController::Base
# Returns an array of ids from params[:id], params[:ids].
def ids_list(other_attrs=[])
+ other_attrs = Array(other_attrs) unless other_attrs.is_a?(Array)
other_attrs.each do |attr_key|
return Array(params[attr_key]) if params.include?(attr_key)
end
diff --git a/src/app/controllers/pools_controller.rb b/src/app/controllers/pools_controller.rb
index 20a5572..0668217 100644
--- a/src/app/controllers/pools_controller.rb
+++ b/src/app/controllers/pools_controller.rb
@@ -244,7 +244,7 @@ class PoolsController < ApplicationController
failed = []
permission_failed = []
error_messages = []
- Pool.find(ids_list('pools_selected')).each do |pool|
+ Pool.find(ids_list(['pools_selected'])).each do |pool|
if pool.id == MetadataObject.lookup("self_service_default_pool").id
error_messages << t("pools.flash.error.default_pool_not_deleted")
elsif !check_privilege(Privilege::MODIFY, pool)
--
1.7.6.5
More information about the aeolus-devel
mailing list