From a949c564495c5a59a64fba79beffda920e3fc81a Mon Sep 17 00:00:00 2001 From: Luis Porras Date: Wed, 20 Nov 2013 12:08:19 -0300 Subject: [PATCH] on :import_aborted notify error --- lib/importr/importer.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/importr/importer.rb b/lib/importr/importer.rb index 12cd6a1..07e1b91 100644 --- a/lib/importr/importer.rb +++ b/lib/importr/importer.rb @@ -28,6 +28,10 @@ def initialize(file, options = {}) notify(:base, error: e.message) end + on :import_aborted do |message| + notify(:base, error: message) + end + on :import_finished do data_import.update_attribute(:finished, true) if data_import end @@ -47,7 +51,7 @@ def update_counters(err= {}) total_rows: row_count, } if data_import - data_import.update_attributes(@counters) + data_import.update_attributes(@counters) add_error(err) unless err.blank? end end