From 11f232a2003beb2a5e494b22c31b637771ab88ca Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Tue, 10 Jun 2014 13:08:19 +0800 Subject: [PATCH] Fix QuotedTableName --- scope.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scope.go b/scope.go index b6a6c27e..77268a35 100644 --- a/scope.go +++ b/scope.go @@ -218,7 +218,11 @@ func (scope *Scope) QuotedTableName() string { if scope.Search != nil && len(scope.Search.TableName) > 0 { return scope.Search.TableName } else { - return scope.Quote(scope.TableName()) + keys := strings.Split(scope.TableName(), ".") + for i, v := range keys { + keys[i] = scope.Quote(v) + } + return strings.Join(keys, ".") } }