Sha256: 2e3546b86ae906be7c2513a2f20554e8f9ac3e59432f702d504355250ce8afd8
Contents?: true
Size: 380 Bytes
Versions: 30
Compression:
Stored size: 380 Bytes
Contents
module Renalware log "Adding Countries" do file_path = File.join(File.dirname(__FILE__), "countries.csv") CSV.foreach(file_path, headers: true) do |row, index| System::Country.find_or_create_by!( name: row["name"], alpha2: row["alpha2"], alpha3: row["alpha3"] ).tap{ |country| country.position = index } end end end
Version data entries
30 entries across 30 versions & 1 rubygems