Class: MailRotator::MailerStore

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/mailer_store.rb

Instance Method Summary collapse

Instance Method Details

#activateObject



13
14
15
# File 'app/models/mailer_store.rb', line 13

def activate
  self.update_attributes(active: true)
end

#incrementObject



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

Returns:

  • (Boolean)


26
27
28
# File 'app/models/mailer_store.rb', line 26

def over_limit?
  sent_count >= limit
end

#resetObject



22
23
24
# File 'app/models/mailer_store.rb', line 22

def reset
  self.update_attributes(sent_count: 0, active: false)
end