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:
@ -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'));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user