Class: Emails::DestroyService
- Inherits:
-
BaseService
- Object
- BaseService
- Emails::DestroyService
- Defined in:
- app/services/emails/destroy_service.rb
Instance Attribute Summary
Attributes inherited from BaseService
Instance Method Summary collapse
Methods inherited from BaseService
#initialize, #notification_service
Constructor Details
This class inherits a constructor from Emails::BaseService
Instance Method Details
#execute(email) ⇒ Object
5 6 7 8 9 |
# File 'app/services/emails/destroy_service.rb', line 5 def execute(email) raise StandardError, 'Cannot delete primary email' if email.user_primary_email? email.destroy && update_secondary_emails!(email.email) end |