Skip to content

Instantly share code, notes, and snippets.

@KingofHamyang
Created January 8, 2020 04:34
Show Gist options
  • Save KingofHamyang/1098b95508e204e948c9d30b82fbbb38 to your computer and use it in GitHub Desktop.
Save KingofHamyang/1098b95508e204e948c9d30b82fbbb38 to your computer and use it in GitHub Desktop.
require 'csv'
csv_text = File.read('../csvs/immutable_marking_botem_weight.csv')
csv = CSV.parse(csv_text, :headers => true)
csv.each do |row|
Shop::Weight.where(:shop_id => row["shop_id"], :date => row["date"]).first.update(:botem => row["botem"])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment