Bust the cache after import
Without this exporting, deleting and then re-imporing an account would reuse the old cache entries since the IDs are the same, but those cache entries will likely have the old account ID and would break
This commit is contained in:
@@ -71,7 +71,9 @@ class Account::DataTransfer::RecordSet
|
||||
def import_batch(files)
|
||||
batch_data = files.map do |file|
|
||||
data = load(file)
|
||||
data.slice(*attributes).merge("account_id" => account.id)
|
||||
data.slice(*attributes).merge("account_id" => account.id).tap do |record_data|
|
||||
record_data["updated_at"] = Time.current if record_data.key?("updated_at")
|
||||
end
|
||||
end
|
||||
|
||||
model.insert_all!(batch_data)
|
||||
|
||||
Reference in New Issue
Block a user