mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-04 13:05:19 +02:00
17 lines
350 B
Ruby
17 lines
350 B
Ruby
|
class DataCacheClearJob < ApplicationJob
|
||
|
queue_as :default
|
||
|
|
||
|
def perform(family)
|
||
|
ActiveRecord::Base.transaction do
|
||
|
ExchangeRate.delete_all
|
||
|
Security::Price.delete_all
|
||
|
family.accounts.each do |account|
|
||
|
account.balances.delete_all
|
||
|
account.holdings.delete_all
|
||
|
end
|
||
|
|
||
|
family.sync_later
|
||
|
end
|
||
|
end
|
||
|
end
|