From a9ac3e10a79a57705bf3920d3b537d90dd172eec Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Fri, 4 Jul 2014 08:19:11 +0800 Subject: [PATCH] Support upcase column names --- callback_query.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/callback_query.go b/callback_query.go index 113382e1..61db20e5 100644 --- a/callback_query.go +++ b/callback_query.go @@ -2,6 +2,7 @@ package gorm import ( "reflect" + "strings" "time" ) @@ -46,7 +47,7 @@ func Query(scope *Scope) { columns, _ := rows.Columns() var values []interface{} for _, value := range columns { - field := elem.FieldByName(snakeToUpperCamel(value)) + field := elem.FieldByName(snakeToUpperCamel(strings.ToLower(value))) if field.IsValid() { values = append(values, field.Addr().Interface()) } else {