From 3425c1d38d18375cc3e27d0c3a8c0e7907eb1b3e Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Tue, 13 Sep 2016 08:24:29 +0800 Subject: [PATCH] Set PrimaryField IsBlank to false after read from returning value --- callback_create.go | 1 + 1 file changed, 1 insertion(+) diff --git a/callback_create.go b/callback_create.go index 14b82047..7a6dea94 100644 --- a/callback_create.go +++ b/callback_create.go @@ -118,6 +118,7 @@ func createCallback(scope *Scope) { } } else { if err := scope.SQLDB().QueryRow(scope.SQL, scope.SQLVars...).Scan(primaryField.Field.Addr().Interface()); scope.Err(err) == nil { + primaryField.IsBlank = false scope.db.RowsAffected = 1 } }