Say you’re working on something that uses acts_as_attachment. Also say that the person who wrote it decided that all the different models’ attachments would save in the same place. Also suppose that you want to change the file location of all those uploads.
Well, here’s a quick and dirty migration that’ll save you from moving files manually.
Automove Files for Storage Changes, with acts_as_attachment
Originally I wanted to do something like Attachment.new( OldAttachment.find(?).attributes ), but there were issues with that because acts_as_attachment wants uploaded data to be a tmp file or some crap. This ended up being the easier way, all in all.
Use with care.