Importing Legacy Transactions
drush opened this issue · 5 comments
Does anyone have a good pattern for importing legacy transactions into DE? This would require recording a transfer at a specific time in the past.
It looks like there are two options:
-
Modifications to transfer/process/create_lines in order to override default dates
-
Override Time.now or AR setters for created_at/updated_at in a block outside the transfer creation.
Any ideas, thoughts, gists welcome.
hi @drush, I can't say I've ever done this. I wonder if the DoubleEntry.transfer
method should accept a timestamp option for this use case.
You should test this approach thoroughly for your use case, but you can try time travel: https://github.com/travisjeffery/timecop to set the time of the transaction. Your intermediate balances will all have to be recalculated if you do this, so beware.