Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8240

Show
Ignore:
Timestamp:
11/29/07 22:25:42 (1 year ago)
Author:
xal
Message:

Removed documentation for the removed rollback! method on transactions and mention ActiveRecord::Rollback [cody]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activerecord/lib/active_record/transactions.rb

    r8113 r8240  
    3030    # Exceptions will force a ROLLBACK that returns the database to the state before the transaction was begun. Be aware, though, 
    3131    # that the objects by default will _not_ have their instance data returned to their pre-transactional state. 
    32     # 
    33     # == Rolling back a transaction manually 
    34     # 
    35     # Instead of relying on exceptions to rollback your transactions, you can also do so manually from within the scope 
    36     # of the transaction by accepting a yield parameter and calling rollback! on it. Example: 
    37     # 
    38     #   transaction do |transaction| 
    39     #     david.withdrawal(100) 
    40     #     mary.deposit(100) 
    41     #     transaction.rollback! # rolls back the transaction that was otherwise going to be successful 
    42     #   end 
    4332    # 
    4433    # == Different ActiveRecord classes in a single transaction 
     
    8170    # 
    8271    # Also have in mind that exceptions thrown within a transaction block will be propagated (after triggering the ROLLBACK), so you 
    83     # should be ready to catch those in your application code. 
     72    # should be ready to catch those in your application code. One exception is the ActiveRecord::Rollback exception, which will 
     73    # trigger a ROLLBACK when raised, but not be re-raised by the transaction block. 
    8474    module ClassMethods 
    8575      def transaction(&block)