Skip to content

Commit

Permalink
Fix/Snapshot version issue (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
mansoorkhan96 authored Mar 16, 2024
1 parent 5c21008 commit 927acf2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Versionable.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,11 @@ public function shouldBeVersioning(): bool
return call_user_func([$this, 'shouldVersioning']);
}

return ! empty($this->getVersionableAttributes());
if ($this->versions()->count() === 0 || Arr::hasAny($this->getDirty(), $this->versionable)) {
return true;
}

return false;
}

public function getVersionableAttributes(array $replacements = []): array
Expand Down

0 comments on commit 927acf2

Please sign in to comment.