xls_porter 1.1 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/xls_porter.rb +6 -2
- metadata +1 -1
data/lib/xls_porter.rb
CHANGED
@@ -80,12 +80,16 @@ module XlsPorter
|
|
80
80
|
#track all updates
|
81
81
|
if not record.changed.empty?
|
82
82
|
begin
|
83
|
-
record.save
|
83
|
+
if record.save
|
84
|
+
puts "Record #{record.class}:#{record.id} saved"
|
85
|
+
else
|
86
|
+
puts "Record Error #{record.error_message}"
|
87
|
+
end
|
84
88
|
rescue Exception => exception
|
85
89
|
update = "exception"
|
86
90
|
update_notes = exception.to_s
|
87
91
|
end
|
88
|
-
updates << record.attributes.merge({ update
|
92
|
+
updates << record.attributes.merge({ 'update' => update, 'update_notes' => update_notes }) # if %w(new updated).include?(update) #not record.changed.empty?
|
89
93
|
end
|
90
94
|
end
|
91
95
|
return {:columns => (%w(update update_notes) + columns), :updates => updates, :model => model.name}
|