Paperclip: Mailbox Integration

I am using mailboxer gem and I do not know how to use it with Paperclip (Message Class).

Using a clip with the User class:

class User < ActiveRecord::Base has_attached_file :picture end 

How can I add has_attached_file to the Message class (there is no message.rb in the models)?

Thanks.

+4
source share
1 answer

Two solutions:

  • use the native application made with the carrier ( source )

  • Monkey Patch Message :

in the initializer:

 Message.class_eval do #your paperclip code goes here end 

And don't forget the migration !

+2
source

All Articles