mirror of
https://github.com/we-promise/sure.git
synced 2026-05-12 23:25:00 +00:00
refactor(accounts): Improve destroy_later atomicity and add controller error handling (#1395)
* refactor(accounts): Improve destroy_later atomicity and add controller error handling * Address PR comment --------- Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com> Co-authored-by: Juan José Mata <juanjo.mata@gmail.com>
This commit is contained in:
@@ -311,8 +311,10 @@ class Account < ApplicationRecord
|
||||
end
|
||||
|
||||
def destroy_later
|
||||
mark_for_deletion!
|
||||
DestroyJob.perform_later(self)
|
||||
transaction do
|
||||
mark_for_deletion!
|
||||
DestroyJob.perform_later(self)
|
||||
end
|
||||
end
|
||||
|
||||
# Override destroy to handle error recovery for accounts
|
||||
|
||||
Reference in New Issue
Block a user