Class: RailsErrorDashboard::Commands::UnsnoozeError
- Inherits:
-
Object
- Object
- RailsErrorDashboard::Commands::UnsnoozeError
- Defined in:
- lib/rails_error_dashboard/commands/unsnooze_error.rb
Overview
Command: Unsnooze an error (clear snoozed_until) This is a write operation that clears the snoozed_until field on an ErrorLog record
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(error_id) ⇒ UnsnoozeError
constructor
A new instance of UnsnoozeError.
Constructor Details
#initialize(error_id) ⇒ UnsnoozeError
Returns a new instance of UnsnoozeError.
12 13 14 |
# File 'lib/rails_error_dashboard/commands/unsnooze_error.rb', line 12 def initialize(error_id) @error_id = error_id end |
Class Method Details
.call(error_id) ⇒ Object
8 9 10 |
# File 'lib/rails_error_dashboard/commands/unsnooze_error.rb', line 8 def self.call(error_id) new(error_id).call end |
Instance Method Details
#call ⇒ Object
16 17 18 19 20 |
# File 'lib/rails_error_dashboard/commands/unsnooze_error.rb', line 16 def call error = ErrorLog.find(@error_id) error.update!(snoozed_until: nil) error end |