This commit is contained in:
Andrew Zhao 2017-05-09 23:42:04 -07:00
parent 9acaa33324
commit 6369712e58

View File

@ -677,7 +677,7 @@ func (scope *Scope) whereSQL() (sql string) {
primaryConditions, andConditions, orConditions []string
)
if !scope.Search.Unscoped && hasDeletedAtField {
if !scope.Search.Unscoped && hasDeletedAtField && !scope.Search.raw {
sql := fmt.Sprintf("%v.%v IS NULL", quotedTableName, scope.Quote(deletedAtField.DBName))
primaryConditions = append(primaryConditions, sql)
}