Merge 6369712e58b64653dd84d26cc3ae54e55ff9c128 into 9acaa33324bbcc78239a1c913d4f1292c12177b9

This commit is contained in:
Andrew Zhao 2017-05-10 07:04:15 +00:00 committed by GitHub
commit 98fd85f8d4

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)
}