From 4d59b23429397e7fb1fbfba1f89a9c5f2c31da55 Mon Sep 17 00:00:00 2001 From: Alexis Reigel <mail@koffeinfrei.org> Date: Thu, 31 May 2018 23:21:51 +0200 Subject: [PATCH] add documentation for the report --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 2623a12..2f7602b 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,22 @@ import.errors[:model] # => [#<struct Excelsior::Error row=3, errors=["First name can't be blank"]>] ``` +### Report + +A summary of the successfully inserted and failed records is available after +running the importer. + +```ruby +import = UserImport.new +import.run + +import.report +# => #<struct Excelsior::Report inserted=2, failed=1> + +import.total +# => 3 +``` + ### Extended API You may want to pass an excel file per instance. You can also define your own -- GitLab