Friday, April 27, 2007

Checking if a method called in transaction

Sometimes it's comforting to know your method is called within a transaction.


if Thread.current['open_transactions'].nil? ||
Thread.current['open_transactions'] == 0


will do. Any better idea?

No comments: