diff --git a/app/models/ems_refresh/save_inventory.rb b/app/models/ems_refresh/save_inventory.rb index 68610327daf..5d835ff9964 100644 --- a/app/models/ems_refresh/save_inventory.rb +++ b/app/models/ems_refresh/save_inventory.rb @@ -98,7 +98,7 @@ def save_vms_inventory(ems, hashes, target = nil) h[:location] = "unknown" if h[:location].blank? # build a type-specific vm or template - found = ems.vms_and_templates.build(h) + found = ems.vms_and_templates.klass.new(h) else vms_by_uid_ems[h[:uid_ems]].delete(found) h.delete(:type)