1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-04 13:05:19 +02:00
Maybe/app/jobs/data_cache_clear_job.rb

17 lines
350 B
Ruby
Raw Normal View History

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