From 5ddca7c427a2e7558191412ad70cc210901164c5 Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Tue, 30 Jun 2015 10:39:29 +0800 Subject: [PATCH] Fix table name for association --- scope.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scope.go b/scope.go index de1b6159..8ff514a9 100644 --- a/scope.go +++ b/scope.go @@ -259,7 +259,7 @@ func (scope *Scope) TableName() string { return tabler.TableName(scope.db) } - return scope.GetModelStruct().TableName(scope.db) + return scope.GetModelStruct().TableName(scope.db.Model(scope.Value)) } func (scope *Scope) QuotedTableName() (name string) {