From 08c6a5ad0b26c12fa0aaed058122e964f331489e Mon Sep 17 00:00:00 2001 From: Joe Ferrucci Date: Sun, 22 Jan 2017 09:04:40 -0800 Subject: [PATCH] Update models.md Incorrect syntax. --- documents/models.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documents/models.md b/documents/models.md index 4935e30c..e0ed1f7c 100644 --- a/documents/models.md +++ b/documents/models.md @@ -164,7 +164,7 @@ Save records having `UpdatedAt` field will set it to current time. ```go db.Save(&user) // will set `UpdatedAt` to current time -db.Model(&user).Update("name", "jinzhu") // will set `UpdatedAt` to current time +db.Model(&user).Update("UpdatedAt", time.Now()) // will set `UpdatedAt` to current time ``` ### Use `DeletedAt` to store record's deleted time if field exists