1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-30 04:23:11 +03:00

Drawings now generate revisions, not replace

Updated drawing update test to accomodate.
Image deletion system now takes revisions into account.
This commit is contained in:
Dan Brown
2018-05-13 17:41:35 +01:00
parent d5b922aa50
commit 13ad0031d6
8 changed files with 112 additions and 40 deletions

View File

@ -28,4 +28,15 @@ class Image extends Ownable
{
return $this->hasMany(ImageRevision::class);
}
/**
* Get the count of revisions made to this image.
* Based off numbers on revisions rather than raw count of attached revisions
* as they may be cleared up or revisions deleted at some point.
* @return int
*/
public function revisionCount()
{
return intval($this->revisions()->max('revision'));
}
}