From 607870f0aa50b15153b7b71986d89dac22af5b31 Mon Sep 17 00:00:00 2001 From: Ryoga Kitagawa Date: Tue, 21 Apr 2020 10:33:43 +0900 Subject: [PATCH] Remove unnecessary clone. --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 3db87870..a6588b24 100644 --- a/main.go +++ b/main.go @@ -732,7 +732,7 @@ func (s *DB) AddForeignKey(field string, dest string, onDelete string, onUpdate // RemoveForeignKey Remove foreign key from the given scope, e.g: // db.Model(&User{}).RemoveForeignKey("city_id", "cities(id)") func (s *DB) RemoveForeignKey(field string, dest string) *DB { - scope := s.clone().NewScope(s.Value) + scope := s.NewScope(s.Value) scope.removeForeignKey(field, dest) return scope.db }