diff --git a/callback_query.go b/callback_query.go index b59a60a5..113382e1 100644 --- a/callback_query.go +++ b/callback_query.go @@ -61,7 +61,7 @@ func Query(scope *Scope) { } } - if !anyRecordFound && !isSlice { + if !anyRecordFound { scope.Err(RecordNotFound) } } diff --git a/main_test.go b/main_test.go index 78e79f23..7310dd40 100644 --- a/main_test.go +++ b/main_test.go @@ -419,12 +419,8 @@ func TestWhere(t *testing.T) { } var users []User - if db.Where("name = ?", "none-noexisting").Find(&users).Error != nil { - t.Errorf("Shouldn't return error when looking for none existing records with find") - } - - if len(users) != 0 { - t.Errorf("Users should be empty") + if !db.Where("name = ?", "none-noexisting").Find(&users).RecordNotFound() { + t.Errorf("Should get RecordNotFound error when looking for none existing records") } }