Displaying 1 result from an estimated 1 matches for "schedule_store".
2007 May 01
5
duplicate key violates unique constraint
...doing this in a block). I find that I can''t create
separate entries manually after the import. It complains about a
duplicate primary key. I''ve tried Schedule.id += 1 but id= either
isn''t defined or accessible in the class
Here is my code:
FasterCSV.foreach("schedule_store/#{@schedule_file.filename}",
"r") do |row|
unless row[3] == "CRN"
# This would be faster as straight SQL if the current method
# slows down too much.
#
# Would probably be cleaner with straight SQL too.
self.associate(row[0],...