forked from jhawthorn/discard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wrap discard methods in a transaction
This seeks to solve issue: jhawthorn#77 Given the situation where a `before/after` callback fails, particularly with related records, we shouldn't still discard records. Note: This is leveraging a private API that exists in [ActiveRecord::Transactions](https://github.com/rails/rails/blob/cd2949d2d936daa89b7e23f816f1c004aee85461/activerecord/lib/active_record/transactions.rb#L345)
- Loading branch information
Showing
1 changed file
with
28 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters