I''ve been trying to make sure that all updates being done on a group of records are done only if they all would be completed. I don''t want them to go through should one of them not validate. So I came up with the two functions at the link below : http://rafb.net/paste/results/ngL5KR74.html Both of them result in the records that don''t validate not being updated, however it doesn''t stop the others from beind recorded and updated. If someone could explain how I could get around this or better how transaction looks for failures on which it then rollsback I''d apprecite it. -Paul
Paul wrote:> If someone could explain how I could get around this or better how > transaction looks for failures on which it then rollsback I''d > apprecite it.Transactions are rolled back if an exception is thrown. Tim. -- Tim Bates tim-kZbwfhiKUx26c6uEtOJ/EA@public.gmane.org
> I''ve been trying to make sure that all updates being done on a group > of records are done only if they all would be completed. I don''t want > them to go through should one of them not validate. So I came up with > the two functions at the link below :How about: if settings.all? (|s| s.valid?} do #update them else #throw error end Hadley