Here’s what I could use your help with.
In my app, I need to create AttachmentTemps (temporary attachments that go to S3)
I create these attachmenttemp (0 to 100) possible, in the controller.
What I want to do is somehow store the attachmentTemp IDs in the a separate model IncomingMail.
Then later, when delayed_job access incoming mail to do all the image processing etc, I want to use the attachmenttemp ids (if any) to get the @attachmenttemp record, and do some process on it.
Suggestions? Thanks
I would recommending having a model like this:
AttachmentTemp (id, incoming_mail_id, ….)
IncomingMail (id, ….)
Instead of storing the attachment ids as a hash, simply store the incoming_mail_id on the attachment_temps table, that way when you are processing an IncomingMail object you can simply query the attachment_temps table for all the related objects using the incoming_mail_id.