From e30cf3bbd1e6286b8d6c9b6dcb578d405c350b45 Mon Sep 17 00:00:00 2001 From: Paolo Galeone Date: Mon, 8 Dec 2014 20:33:31 +0100 Subject: [PATCH] Fix number of columns affected. Is always one. The old parameter was the numer of fields affected --- callback_create.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/callback_create.go b/callback_create.go index ed2589dd..4c909e1c 100644 --- a/callback_create.go +++ b/callback_create.go @@ -72,7 +72,7 @@ func Create(scope *Scope) { if names, columnsErr := rows.Columns(); columnsErr != nil { ids := make([]interface{}, len(names)) if scope.Err(rows.Scan(ids...)) == nil { - scope.db.RowsAffected = int64(len(names)) + scope.db.RowsAffected = 1 } } }