• R
    Should attempt `committed!`/`rolledback!` to all enrolled records in the transaction · 718a32ca
    Ryuta Kamizono 提交于
    Currently, `committed!`/`rolledback!` will only be attempted for the
    first enrolled record in the transaction, that will cause some
    problematic behaviors.
    
    The first one problem, `clear_transaction_record_state` won't be called
    even if the transaction is finalized except the first enrolled record.
    This means that de-duplicated records in the transaction won't refer
    latest state (e.g. won't happen rolling back record state).
    
    The second one problem, the enrolled order is not always the same as the
    order in which the actions actually happened, the first enrolled record
    may succeed no actions (e.g. `destroy` has already succeeded on another
    record during `before_destroy`), it will lose to fire any transactional
    callbacks.
    
    To avoid both problems, we should attempt `committed!`/`rolledback!` to
    all enrolled records in the transaction.
    718a32ca
transactions.rb 19.9 KB