From 256dbd7142ff91e28a0f844e467bc40cd19a1ed0 Mon Sep 17 00:00:00 2001 From: Weston Platter Date: Sun, 23 Nov 2014 21:30:34 -0700 Subject: [PATCH] related to #286. remove CreatedAt field from generated Update SQL --- callback_update.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/callback_update.go b/callback_update.go index 0e32352f..f6c1e0a4 100644 --- a/callback_update.go +++ b/callback_update.go @@ -52,6 +52,9 @@ func Update(scope *Scope) { if field.DefaultValue != nil && field.IsBlank { continue } + if field.Name == "CreatedAt" { + continue + } sqls = append(sqls, fmt.Sprintf("%v = %v", scope.Quote(field.DBName), scope.AddToVars(field.Field.Interface()))) } }