Sha256: 09848bb184a5202c6d7c15470497be34fdc09718ec14711f4e014f6ae3184008
Contents?: true
Size: 508 Bytes
Versions: 92
Compression:
Stored size: 508 Bytes
Contents
# frozen_string_literal: true module Renalware log "Adding Countries" do return if System::Country.count.positive? file_path = File.join(File.dirname(__FILE__), "countries.csv") countries = [] index = 0 CSV.foreach(file_path, headers: true) do |row| countries << System::Country.new( name: row["name"], alpha2: row["alpha2"], alpha3: row["alpha3"], position: index ) index += 1 end System::Country.import! countries end end
Version data entries
92 entries across 92 versions & 1 rubygems