File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
src/Illuminate/Database/Eloquent Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ protected function performDeleteOnModel()
49
49
if ($ this ->forceDeleting ) {
50
50
$ this ->exists = false ;
51
51
52
- return $ this ->setKeysForSaveQuery ( $ this ->newModelQuery ())->forceDelete ();
52
+ return $ this ->newModelQuery ()-> where ( $ this ->getKeyName (), $ this -> getKey ())->forceDelete ();
53
53
}
54
54
55
55
return $ this ->runSoftDelete ();
@@ -62,7 +62,7 @@ protected function performDeleteOnModel()
62
62
*/
63
63
protected function runSoftDelete ()
64
64
{
65
- $ query = $ this ->setKeysForSaveQuery ( $ this ->newModelQuery ());
65
+ $ query = $ this ->newModelQuery ()-> where ( $ this ->getKeyName (), $ this -> getKey ());
66
66
67
67
$ time = $ this ->freshTimestamp ();
68
68
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ public function testDeleteSetsSoftDeletedColumn()
19
19
$ model = m::mock (DatabaseSoftDeletingTraitStub::class);
20
20
$ model ->shouldDeferMissing ();
21
21
$ model ->shouldReceive ('newModelQuery ' )->andReturn ($ query = m::mock (stdClass::class));
22
- $ model ->shouldReceive ('setKeysForSaveQuery ' )->once ()->with ($ query )->andReturn ($ query );
22
+ $ query ->shouldReceive ('where ' )->once ()->with (' id ' , 1 )->andReturn ($ query );
23
23
$ query ->shouldReceive ('update ' )->once ()->with ([
24
24
'deleted_at ' => 'date-time ' ,
25
25
'updated_at ' => 'date-time ' ,
You can’t perform that action at this time.
0 commit comments