I’m trying to create a plugin to handle Mail gem’s attachment.
I get the content of the mail attachment by calling the
attachment#decoded. This returns me a string.
I’m thinking of writing the content to a tempfile(with the filename, content type, and all) and going with the usual workflow of creating an attachment(the activerecord workflow where file is assigned when creating a record, and shrine uploads it).
The question is, is this a good way to deal with something like this?