Module

Transactions

There's no documentation for this item.

Modules
ClassMethods Transactions are protective blocks where SQL statements are only permanent if they can all succeed as one atomic action. The classic example is a transfer between two accounts where you can only have a deposit if the withdrawal succeeded and vice versa. Transactions enforce the integrity of the database and guard the data against program errors or database break-downs. So basically you should use transaction blocks whenever you have a number of statements that must be executed together or not at all. Example:
Classes
TransactionError
Public Methods
destroy_with_transactions
included
rollback_active_record_state! Reset id and @new_record if the transaction rolls back.
save_with_transactions
save_with_transactions!
transaction
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.