Topic: Test if the database has been changed at all.

Hi there,

I have some methods which I want to test to make sure that they do not change anything in the database if they fail. Is there any way within the Rails framework or some sneaky trick that someone can think of that will allow me to check that nothing has been changed by the method? It would be very impractical, if not impossible to do this manually.

Many Thanks,
James

Re: Test if the database has been changed at all.

Try wrapping your method in a transaction.

http://api.rubyonrails.org/classes/Acti … thods.html