Luke Scott said over 1 year ago on Importing and Exporting CSV Data :
  David Kimura  

I got it working!

  def self.import(file)
    CSV.foreach(file.path, headers: true, header_converters: :symbol) do |row|
      customer_hash = row.to_hash
      customer = find_or_create_by!(sla_number: customer_hash[:sla_number])
      customer.update(customer_hash)
    end
  end

Converting the headers to symbols and calling it as a symbol on the customer_hash did the trick.