Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…WITH taxonomy
  • Loading branch information...
commit 588951fb2e86240b5793abc98d9508de28628ba1 1 parent 4ab67d2
@isratrade isratrade authored ohadlevy committed
View
4 app/controllers/hosts_controller.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
View
4 lib/foreman/controller/host_details.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.