Ok, how does everyone else do transactions in development mode? If I get a exception within a transaction, I get the ruby exception screen, I want rails to complete the block code, and then rollback the transaction. Is there a way to disable the exception screen before the transaction, and then enable it after the transaction? Thanks! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Joe wrote:> Ok, how does everyone else do transactions in development mode? If I > get a exception within a transaction, I get the ruby exception screen, > I want rails to complete the block code, and then rollback the > transaction. Is there a way to disable the exception screen before the > transaction, and then enable it after the transaction? > > Thanks!You could wrap the transaction in an exception block and in the rescue do nothing. The roll back should happen. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Hmm, sounds odd that you''d want to continue executing the block. What exactly are you doing, there may be another way about it. If you can''t change your design, you could try something like this: def do_extra end begin MyModel.transaction do obj.bork("lala") # Raise do_extra end ensure do_extra end You''d probably need various versions of extra functions depending on where the exception is raised in block. I recommend trying to refactor your code if possible. On 21/10/06, Joe <jnkjok-QJzyweO1arydJdNcDFJN0w@public.gmane.org> wrote:> > > Ok, how does everyone else do transactions in development mode? If I > get a exception within a transaction, I get the ruby exception screen, > I want rails to complete the block code, and then rollback the > transaction. Is there a way to disable the exception screen before the > transaction, and then enable it after the transaction? > > Thanks! > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Thanks for the help, that seemed to do the trick. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---