Sha256: db88ee4e5957612952a0441c376d4bd299c0eb6a4f99cb54305a7f8d5c4c2c9e

Contents?: true

Size: 436 Bytes

Versions: 2

Compression:

Stored size: 436 Bytes

Contents

# frozen_string_literal: true

module Renalware
  log "Adding Default Event Types e.g. Biopsy, Swabs" do
    file_path = File.join(File.dirname(__FILE__), "event_types.csv")

    CSV.foreach(file_path, headers: true) do |row|
      Events::Type.find_or_create_by!(
        name: row["name"],
        event_class_name: row["event_class_name"],
        slug: row["slug"],
        category_id: row["category_id"]
      )
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
renalware-core-2.1.1 db/seeds/default/events/event_types.rb
renalware-core-2.1.0 db/seeds/default/events/event_types.rb