Module: Mailboxer::Models::Messageable::ClassMethods
- Defined in:
- lib/mailboxer/models/messageable.rb
Overview
declare the class level helper methods which will load the relevant instance methods defined below when invoked
Instance Method Summary collapse
-
#acts_as_messageable ⇒ Object
enables a class to send and receive messages to members of the same class - currently assumes the model is of class type ‘User’, some modifications to the migrations and model classes will need to be made to use a model of different type.
Instance Method Details
#acts_as_messageable ⇒ Object
enables a class to send and receive messages to members of the same class - currently assumes the model is of class type ‘User’, some modifications to the migrations and model classes will need to be made to use a model of different type
options:
-
:received - the mailbox type to store received messages (defaults to :inbox)
-
:sent - the mailbox type to store sent messages (defaults to :sentbox)
-
:deleted - the mailbox type to store deleted messages (defaults to :trash)
example:
:received => :in, :sent => :sent, :deleted => :garbage
24 25 26 27 28 29 30 |
# File 'lib/mailboxer/models/messageable.rb', line 24 def has_many :mailboxer_messages cattr_accessor :mailbox_types has_many :mailboxer_mails, :order => 'created_at DESC', :dependent => :delete_all include Mailboxer::Models::Messageable::InstanceMethods end |