mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Roll back from model touchables
This commit is contained in:
parent
f83af0bf30
commit
fa369e79cf
@ -150,6 +150,10 @@ class DocumentController extends BaseController
|
||||
$document->fill($request->all());
|
||||
$document->save();
|
||||
|
||||
if($document->documentable) {
|
||||
$document->documentable->touch();
|
||||
}
|
||||
|
||||
return $this->itemResponse($document->fresh());
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ class Document extends BaseModel
|
||||
];
|
||||
|
||||
protected $touches = [
|
||||
'documentable'
|
||||
// 'documentable'
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -22,6 +22,9 @@ class DocumentRepository extends BaseRepository
|
||||
{
|
||||
$document->deleteFile();
|
||||
$document->forceDelete();
|
||||
|
||||
if($document->documentable)
|
||||
$document->documentable->touch();
|
||||
}
|
||||
|
||||
public function restore($document)
|
||||
|
@ -49,7 +49,7 @@ trait SavesDocuments
|
||||
))->handle();
|
||||
}
|
||||
|
||||
// $entity->touch();
|
||||
$entity->touch();
|
||||
}
|
||||
|
||||
public function saveDocument($document, $entity, $is_public = true)
|
||||
@ -78,7 +78,7 @@ trait SavesDocuments
|
||||
$is_public
|
||||
))->handle();
|
||||
|
||||
// $entity->touch();
|
||||
$entity->touch();
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ class DocumentsApiTest extends TestCase
|
||||
|
||||
public function testDocumentFilters()
|
||||
{
|
||||
Document::query()->withoutEvents()->withTrashed()->cursor()->each(function ($d) {
|
||||
Document::query()->withTrashed()->cursor()->each(function ($d) {
|
||||
$d->forceDelete();
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user