Displaying 1 result from an estimated 1 matches for "trans_date_at".
2006 Mar 21
8
Loading the contents of a CSV file to a database
...rCSV.read("c:/nugget/statement.csv")
end
def csv_load
require ''faster_csv''
@csv_trans_actions = FasterCSV.read("c:/nugget/statement.csv")
for trans_action in @trans_actions
for csv_trans_action in @csv_trans_actions
trans_action.trans_date_at = csv_trans_action[0]
trans_action.description = csv_trans_action[1]
trans_action.amount = csv_trans_action[2]
trans_action.save
end
end
end
What is funny is that it seems to insert the first row and then throw an
error about a array value being nil...