mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-08 15:05:22 +02:00
* feat: Allow admins to delete family data * feat: Allow self-hosting users to delete cached data * Remove system tests
19 lines
483 B
Ruby
19 lines
483 B
Ruby
class FamilyResetJob < ApplicationJob
|
|
queue_as :default
|
|
|
|
def perform(family)
|
|
# Delete all family data except users
|
|
ActiveRecord::Base.transaction do
|
|
# Delete accounts and related data
|
|
family.accounts.destroy_all
|
|
family.categories.destroy_all
|
|
family.tags.destroy_all
|
|
family.merchants.destroy_all
|
|
family.plaid_items.destroy_all
|
|
family.imports.destroy_all
|
|
family.budgets.destroy_all
|
|
|
|
family.sync_later
|
|
end
|
|
end
|
|
end
|