How to do a rollback

Hi. I’d like to know how can i do a rollback after a
Table.new(params:id)?

thank you

On 11/30/05, Christian G. [email protected]
[email protected] wrote:

Hi. I’d like to know how can i do a rollback after a
Table.new(params:id)?

You need to put it into a transaction:

Table.transaction do

Table.new(…)

more stuff

if you leave the block via an exception, the transaction is

rolled back, if you leave it normally it is committed…

end

Thanks christian!
It worked like charm!