From bf6123b01e265ecfe709738b290c3ea3f6ad9bdc Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Tue, 1 Sep 2020 18:05:26 +0800 Subject: [PATCH] Fix duplicated soft delete clause --- soft_delete.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/soft_delete.go b/soft_delete.go index 484f565c..b13fc63f 100644 --- a/soft_delete.go +++ b/soft_delete.go @@ -25,14 +25,7 @@ func (n DeletedAt) Value() (driver.Value, error) { } func (DeletedAt) QueryClauses(f *schema.Field) []clause.Interface { - return []clause.Interface{ - clause.Where{Exprs: []clause.Expression{ - clause.Eq{ - Column: clause.Column{Table: clause.CurrentTable, Name: f.DBName}, - Value: nil, - }, - }}, - } + return []clause.Interface{SoftDeleteQueryClause{Field: f}} } type SoftDeleteQueryClause struct {