From 0b8c9f29a9e28708c17e0ef1aed71487e8bd356c Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Thu, 4 Jun 2015 12:10:09 +0800 Subject: [PATCH] Find Field by db name also --- scope.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scope.go b/scope.go index 960a653c..11bad777 100644 --- a/scope.go +++ b/scope.go @@ -273,7 +273,7 @@ func (scope *Scope) CombinedConditionSql() string { func (scope *Scope) FieldByName(name string) (field *Field, ok bool) { for _, field := range scope.Fields() { - if field.Name == name { + if field.Name == name || field.DBName == name { return field, true } }