Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Part < ActiveRecord::Base
- def self.import_csv(file)
- CSV.foreach(file) do |row|
- part = Part.new(
- :pn => row[0],
- :description => row[1],
- :list_price => row[2],
- :cost => row[3]
- )
- part.save!
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement