Class: ActiveRecord::Dbt::Seed::Enum::Csv

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/active_record/dbt/seed/enum/csv.rb

Defined Under Namespace

Classes: DoesNotExistColumnError, NotEnumColumnError

Instance Attribute Summary

Attributes included from Base

#enum_column_name, #table_name

Instance Method Summary collapse

Methods included from Base

#initialize

Instance Method Details

#dumpObject



18
19
20
21
22
# File 'lib/active_record/dbt/seed/enum/csv.rb', line 18

def dump
  CSV.generate(headers: true) do |csv|
    rows.each { |row| csv << row }
  end
end

#export_pathObject



14
15
16
# File 'lib/active_record/dbt/seed/enum/csv.rb', line 14

def export_path
  "#{basename}.csv"
end