lib/tasque/task.rb in tasque-0.0.8 vs lib/tasque/task.rb in tasque-0.0.9

- old
+ new

@@ -110,16 +110,18 @@ self.update_columns progress: val, updated_at: Time.now @last_progress_at = Time.now @last_progress_val = val notify end - + end + + state :processing, :cancel do def error!(task_error) raise Tasque::TaskError.new(self, task_error) end end - state :processing, :error do + state :processing, :error, :cancel do attr_accessor :error def error? !@error.nil? end