bug fixed for unscoped

This commit is contained in:
Lunny Xiao 2014-11-05 15:40:44 +08:00
parent f087929082
commit 7db23ba469
1 changed files with 1 additions and 1 deletions

View File

@ -1420,6 +1420,6 @@ func (engine *Engine) FormatTime(sqlTypeName string, t time.Time) (v interface{}
// Always disable struct tag "deleted"
func (engine *Engine) Unscoped() *Session {
session := engine.NewSession()
defer session.Close()
session.IsAutoClose = true
return session.Unscoped()
}