Permalink
Browse files

fixes #2291 undefined method 'to_a' for 75:String when creating host…

… WITH taxonomy
  • Loading branch information...
isratrade authored and ohadlevy committed Mar 7, 2013
1 parent 4ab67d2 commit 588951fb2e86240b5793abc98d9508de28628ba1
Showing with 4 additions and 4 deletions.
  1. +2 −2 app/controllers/hosts_controller.rb
  2. +2 −2 lib/foreman/controller/host_details.rb
@@ -489,8 +489,8 @@ def puppetclass_parameters
private
def taxonomy_scope
- @organization = params[:organization_id].blank? ? nil : params[:organization_id].to_a.map{ |id| Organization.find(id) }
- @location = params[:location_id].blank? ? nil : params[:location_id].to_a.map{ |id| Location.find(id) }
+ @organization = params[:organization_id].blank? ? nil : Organization.find(Array.wrap(params[:organization_id]))
+ @location = params[:location_id].blank? ? nil : Location.find(Array.wrap(params[:location_id]))
end
def find_by_name
@@ -62,8 +62,8 @@ def item_object
end
def taxonomy_scope
- @organization = params[:organization_id].blank? ? nil : params[:organization_id].to_a.map{ |id| Organization.find(id) }
- @location = params[:location_id].blank? ? nil : params[:location_id].to_a.map{ |id| Location.find(id) }
+ @organization = params[:organization_id].blank? ? nil : Organization.find(Array.wrap(params[:organization_id]))
+ @location = params[:location_id].blank? ? nil : Location.find(Array.wrap(params[:location_id]))
end
end

0 comments on commit 588951f

Please sign in to comment.