Fix use SQL as table name
This commit is contained in:
parent
371cd41204
commit
dc55c59b84
3
scope.go
3
scope.go
@ -261,6 +261,9 @@ func (scope *Scope) TableName() string {
|
||||
|
||||
func (scope *Scope) QuotedTableName() (name string) {
|
||||
if scope.Search != nil && len(scope.Search.tableName) > 0 {
|
||||
if strings.Index(scope.Search.tableName, " ") != -1 {
|
||||
return scope.Search.tableName
|
||||
}
|
||||
return scope.Quote(scope.Search.tableName)
|
||||
} else {
|
||||
return scope.Quote(scope.TableName())
|
||||
|
Loading…
x
Reference in New Issue
Block a user