I have rebuilt a project. I’ve migrated databases and now I need to transfer files. I can’t just copy paste them. I need to reprocess them.
How can I load two Rails apps in console (or Rake Task) and work like that:
App1.attaches.all.each do |attach|
new = App2.attach.new attach.attributes
new.file = attach.file.url
new.save
end
I’d add a temporary model to the new application. If you have a model
Asset, I’d addThen you can use both models to convert the data and delete the
LegacyAssetmodel after you’re done.