I have something like this: def import_from_csv(csv_file) Item.transaction do FasterCSV.foreach(csv_file.path) do |row| item = Item.new(:name => row, :units => row, :price => row) item.save! end end #transaction end If I got a negative price I want to rollback all items saved.It's possible?
on 2007-07-04 01:23
on 2007-07-04 01:37
On Jul 4, 2007, at 1:23 AM, Juan Matias wrote: > If I got a negative price I want to rollback all items saved.It's > possible? Sure, just raise an exception. -- fxn