Sha256: cc5dd697318a2d2de02b8d9a3e1d1eff4fe88ea180169c61ccce55f93373ad4d
Contents?: true
Size: 659 Bytes
Versions: 82
Compression:
Stored size: 659 Bytes
Contents
# frozen_string_literal: true module Renalware log "Adding Access Types" do file_path = File.join(File.dirname(__FILE__), "access_types.csv") CSV.foreach(file_path, headers: true) do |row| if row["rr02_code"].present? rr02_code = row["rr02_code"] abbreviation = rr02_code end if row["rr41_code"].present? rr41_code = row["rr41_code"] abbreviation = "#{rr02_code} #{rr41_code}" end Accesses::Type.find_or_create_by!(name: row["name"]) do |type| type.rr02_code = rr02_code type.rr41_code = rr41_code type.abbreviation = abbreviation end end end end
Version data entries
82 entries across 82 versions & 1 rubygems