Class: Whoops::NewEvent
- Inherits:
-
Object
- Object
- Whoops::NewEvent
- Defined in:
- app/models/whoops/new_event.rb
Overview
Receives new event params and processes them
Instance Method Summary collapse
-
#initialize(params) ⇒ NewEvent
constructor
A new instance of NewEvent.
-
#record! ⇒ Object
both records and sends notifications.
Constructor Details
#initialize(params) ⇒ NewEvent
Returns a new instance of NewEvent.
3 4 5 |
# File 'app/models/whoops/new_event.rb', line 3 def initialize(params) @params = params.with_indifferent_access end |
Instance Method Details
#record! ⇒ Object
both records and sends notifications
8 9 10 11 12 13 14 15 16 17 |
# File 'app/models/whoops/new_event.rb', line 8 def record! find_or_build_event_group update_event_group_attributes send_notifications_for_event_group @event_group.archived = false @event_group.save @event_group.events.create(event_params) @event_group end |