ruby-on-railscarrierwavemailboxer

Mailboxer attachments via CarrierWave


I'm trying to send messages with attachments, using CarrierWave. In Mailboxer gem I find that the uploader mounted here. It uses AttachmentUploader for the field :attachment

In base functionality all works good. Attached files stored in public/uploads folder.

But I need add custom functionality to AttachmentUploader (Eg. change the path to store attachments etc.).

I trying create my own attachment_uploader.rb in app/uploaders but it doesn't work.


Solution

  • I just added to initializers/mailboxer.rb

    ...
    class AttachmentUploader < AllAttachmentUploader
    
    end
    

    It allow me inherit from AllAttachmentUploader to AttachmentUploader which was defined in Mailboxer.