mirror of
https://github.com/we-promise/sure.git
synced 2026-04-14 09:34:05 +00:00
* FIX logos * Implement merchant mods * FIX confirm issue * FIX linter * Add recently seen merchants to re-add if needed * Update merge.html.erb * FIX do security check * Add error handling for update failures.
18 lines
476 B
Ruby
18 lines
476 B
Ruby
class DataCleanerJob < ApplicationJob
|
|
queue_as :scheduled
|
|
|
|
def perform
|
|
clean_old_merchant_associations
|
|
end
|
|
|
|
private
|
|
def clean_old_merchant_associations
|
|
# Delete FamilyMerchantAssociation records older than 30 days
|
|
deleted_count = FamilyMerchantAssociation
|
|
.where(unlinked_at: ...30.days.ago)
|
|
.delete_all
|
|
|
|
Rails.logger.info("DataCleanerJob: Deleted #{deleted_count} old merchant associations") if deleted_count > 0
|
|
end
|
|
end
|