Return cloned db instance for AddForeignKey

This commit is contained in:
Jinzhu 2015-06-24 14:09:59 +08:00
parent bdb6fc55e8
commit 2a1d64c3e0
1 changed files with 1 additions and 1 deletions

View File

@ -434,7 +434,7 @@ Example:
func (s *DB) AddForeignKey(field string, dest string, onDelete string, onUpdate string) *DB { func (s *DB) AddForeignKey(field string, dest string, onDelete string, onUpdate string) *DB {
scope := s.clone().NewScope(s.Value) scope := s.clone().NewScope(s.Value)
scope.addForeignKey(field, dest, onDelete, onUpdate) scope.addForeignKey(field, dest, onDelete, onUpdate)
return s return scope.db
} }
func (s *DB) Association(column string) *Association { func (s *DB) Association(column string) *Association {