Class: Noticed::DeliveryMethods::Database
- Defined in:
- lib/noticed/delivery_methods/database.rb
Instance Attribute Summary
Attributes inherited from Base
#logger, #notification, #options, #params, #recipient, #record
Class Method Summary collapse
Instance Method Summary collapse
-
#deliver ⇒ Object
Must return the database record.
Methods inherited from Base
#assign_args, inherited, options, #perform
Class Method Details
.validate!(options) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/noticed/delivery_methods/database.rb', line 9 def self.validate!() super # Must be executed right away so the other deliveries can access the db record raise ArgumentError, "database delivery cannot be delayed" if .key?(:delay) end |
Instance Method Details
#deliver ⇒ Object
Must return the database record
5 6 7 |
# File 'lib/noticed/delivery_methods/database.rb', line 5 def deliver recipient.send(association_name).create!(attributes) end |