Class: MailRotator::MailerStore
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- MailRotator::MailerStore
- Defined in:
- app/models/mailer_store.rb
Instance Method Summary collapse
Instance Method Details
#activate ⇒ Object
13 14 15 |
# File 'app/models/mailer_store.rb', line 13 def activate self.update_attributes(active: true) end |
#increment ⇒ Object
17 18 19 20 |
# File 'app/models/mailer_store.rb', line 17 def increment new_count = self.sent_count + 1 self.update_attributes(sent_count: new_count, active: true) end |
#over_limit? ⇒ Boolean
26 27 28 |
# File 'app/models/mailer_store.rb', line 26 def over_limit? sent_count >= limit end |
#reset ⇒ Object
22 23 24 |
# File 'app/models/mailer_store.rb', line 22 def reset self.update_attributes(sent_count: 0, active: false) end |