On Nov 7, 4:38 pm, Steve Alex <li...@ruby-forum.com> wrote:

> I had create_memo return nil or error message and raised the exception
> in the controller, but that does not seem to be the best way - but it
> works.
>
> The basic question is "How do I tell if a transaction was committed or
> rolled back?"
>
If I were you I wouldn't raise ActiveRecord::Rollback (which
transaction swallows silently). I'd raise my own exception class, it
will still cause the transaction to be rolled back but the exception
will continue upwards and you can then rescue it in your controller,
outside the transaction block and take whatever action is appropriate
to the app

Fred

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to