Module: MailEngine::ActsAsMailReceiver::ClassMethods
- Defined in:
- lib/mail_engine/acts_as_mail_receiver.rb
Instance Method Summary collapse
-
#acts_as_mail_receiver(options) ⇒ Object
NOTICE: Please put this code below any “scope” statement.
Instance Method Details
#acts_as_mail_receiver(options) ⇒ Object
NOTICE: Please put this code below any “scope” statement. Here you can define:
-
Which columns can be acted as payload items.
-
Which methods can be user group scopes.
Example
class User < AR
acts_as_mail_receiver :payload_columns => %w{firstname lastname},
:groups => %w{all english_users chinese_users},
:skip_method_existance_check => true
end
27 28 29 30 31 32 33 |
# File 'lib/mail_engine/acts_as_mail_receiver.rb', line 27 def acts_as_mail_receiver() [:payload_columns, :groups].each do |key| methods_array = Array.wrap([key]) || [] self.send("#{key}=", methods_array) end check_method_existance! unless [:skip_method_existance_check] end |