Let's say I have a model called Theme, which has several attributes setting interface colors. Theme also has a Paperclip attachment, which is a user-generated CSS template. I want to set up a processor to generate a final CSS file, inserting the interface colors into the user-generated template. To do this, I need to access the model data from within the processor. Is this possible?
The processor has an accessor called attachment
this points back to the instance of Paperclip::Attachment. The attachment in turn has an accessor instance
which points to the instance of the original model. So all you should have to do from the processor is call attachment.instance
to get the original model.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With