Add the validation for Book's page count to be greater than 0.
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-04-02 13:38:02 +03:00
parent 730b2b6927
commit 68169cc78b
3 changed files with 56 additions and 1 deletions
@@ -302,6 +302,10 @@ defmodule DecentralisedBookIndex.Metadata.Book do
end
end
validations do
validate numericality(:page_count, greater_than: 0)
end
relationships do
belongs_to :dbi_server, Metadata.DBIServer