Updating Drafts with Attachments
ss44 opened this issue · 3 comments
Came across this issue when working with drafts that may have attachments on rails 3.2.8 (although suspect it affects newer versions).
Attachments are saved on save but doesn't look like draft_update triggers this method so images get marked to be saved but never moved since the save method doesn't get triggered.
While this is in an issue with paperclip, curious if there's a work around that you maybe able to recommend?
For those coming across a similar issue I found adding,
:preserve_files => "true"
and running the manual attachment.save method to work.
@ss44 This is an interesting scenario that I hadn't considered. In my project, I have a completely separate model for storing the attachment and link up the record in the main model with belongs_to
. Then the part that is actually drafted is the foreign key to the appropriate attachment. That way, both file uploads are still preserved fully. Does that make sense?
Could you show a more complete example of your workaround for me to consider?
Handling files is not on the road map for now. Marking as won't fix.
A PR is always welcome.