[PATCH conductor] Fix ApplicationController#ids_list
ifarkas at redhat.com
ifarkas at redhat.com
Thu Jun 14 08:32:24 UTC 2012
From: Imre Farkas <ifarkas at redhat.com>
The String#each method does not exist in Ruby 1.9
---
src/app/controllers/application_controller.rb | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/app/controllers/application_controller.rb b/src/app/controllers/application_controller.rb
index aed6b7e..a090a17 100644
--- a/src/app/controllers/application_controller.rb
+++ b/src/app/controllers/application_controller.rb
@@ -117,10 +117,11 @@ class ApplicationController < ActionController::Base
# Returns an array of ids from params[:id], params[:ids].
def ids_list(other_attrs=[])
- other_attrs.each do |attr_key|
- return Array(params[attr_key]) if params.include?(attr_key)
- end
- if params[:id].present?
+ if other_attrs.is_a?(Enumerable)
+ other_attrs.each do |attr_key|
+ return Array(params[attr_key]) if params.include?(attr_key)
+ end
+ elsif params[:id].present?
return Array(params[:id])
elsif params[:ids].present?
return Array(params[:ids])
--
1.7.10.2
More information about the aeolus-devel
mailing list