Class: Tape::Adapters::ActionMailer::ActiveRecord
- Inherits:
-
Object
- Object
- Tape::Adapters::ActionMailer::ActiveRecord
- Defined in:
- lib/tape/adapters/action_mailer/active_record.rb
Overview
For ActionMailer with delivery_method = :activerecord
Instance Method Summary collapse
- #all ⇒ Object
-
#initialize(options) ⇒ ActiveRecord
constructor
A new instance of ActiveRecord.
- #last ⇒ Object
- #reset ⇒ Object
Constructor Details
#initialize(options) ⇒ ActiveRecord
Returns a new instance of ActiveRecord.
10 11 12 13 14 15 16 17 |
# File 'lib/tape/adapters/action_mailer/active_record.rb', line 10 def initialize() super # Default to Email if no model is configured. unless self.[:model] self.[:model] if const_defined?(Email) end end |
Instance Method Details
#all ⇒ Object
19 20 21 |
# File 'lib/tape/adapters/action_mailer/active_record.rb', line 19 def all model.all.map { |email| parse email.mail } end |
#last ⇒ Object
23 24 25 26 27 |
# File 'lib/tape/adapters/action_mailer/active_record.rb', line 23 def last if email = model.last parse mail end end |
#reset ⇒ Object
29 30 31 |
# File 'lib/tape/adapters/action_mailer/active_record.rb', line 29 def reset model.delete_all end |