確かにこれは私のクラスに問題がありますが、ここにあります:
class Transaction < ActiveRecord::Base
attr_accessible :transaction_date, :amount, :other_info, :type, :purchase
end
require 'csv'
require_relative '../../app/models/transaction'
csv_text = File.read('monthly_csvs/pcbanking.csv')
csv = CSV.parse(csv_text, :headers => false)
csv.each do |row|
puts row[3].to_s
Transaction.create!(transaction_date: row[0], amount: row[1], other_info: row[2], type: row[3], purchase: row[4])
end
エラー:
POS Purchase
rake aborted!
Invalid single-table inheritance type: POS Purchase is not a subclass of Transaction
Pos Purchase は row[3] 要素で、文字列です。