Ticket #11052: Transaction-documentation-update.diff
| File Transaction-documentation-update.diff, 1.6 kB (added by Startrader, 5 months ago) |
|---|
-
activerecord/lib/active_record/transactions.rb
old new 28 28 # 29 29 # This example will only take money from David and give to Mary if neither +withdrawal+ nor +deposit+ raises an exception. 30 30 # Exceptions will force a ROLLBACK that returns the database to the state before the transaction was begun. Be aware, though, 31 # that the objects by defaultwill _not_ have their instance data returned to their pre-transactional state.31 # that the objects will _not_ have their instance data returned to their pre-transactional state. 32 32 # 33 33 # == Different ActiveRecord classes in a single transaction 34 34 # -
activerecord/README
old new 102 102 {Learn more}[link:classes/ActiveRecord/Base.html] 103 103 104 104 105 * Transaction support on both a database and object level. The latter is implemented 106 by using Transaction::Simple[http://railsmanual.com/module/Transaction::Simple] 105 * Transactions 107 106 108 107 # Just database transaction 109 108 Account.transaction do … … 111 110 mary.deposit(100) 112 111 end 113 112 114 # Database and object transaction115 Account.transaction(david, mary) do116 david.withdrawal(100)117 mary.deposit(100)118 end119 120 113 {Learn more}[link:classes/ActiveRecord/Transactions/ClassMethods.html] 121 114 122 115