  def update
    Log.add_info(request, params.inspect)

    @equipment = Equipment.find(params[:id])

    if (params[:groups].nil? or params[:groups].empty?)
      params[:equipment][:groups] = nil
    else
      params[:equipment][:groups] = '|' + params[:groups].join('|') + '|'
    end

    if (params[:teams].nil? or params[:teams].empty?)
      params[:equipment][:teams] = nil
    else
      params[:equipment][:teams] = '|' + params[:teams].join('|') + '|'
    end

    if @equipment.update_attributes(params.require(:equipment).permit(Equipment::PERMIT_BASE))
      flash[:notice] = t('msg.update_success')
      list
      render(:action => 'list')
    else
      render(:controller => 'equipment', :action => 'edit', :id => params[:id])
    end
  end
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.