aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-11-13 17:12:14 +0000
committerMatthew Lemon <y@yulqen.org>2024-11-13 17:12:14 +0000
commit5a9063a04b5a81de31566ad641728ca06fe96927 (patch)
tree2c58d1d6af82e5f667c394f3ab968a71a12ce13a /app/models
parent018affc145e0b3c823e3e7dcaaada39858f5c8b3 (diff)
Adds some validation and further work on the form
Diffstat (limited to 'app/models')
-rw-r--r--app/models/pdfresource.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/pdfresource.rb b/app/models/pdfresource.rb
index 6131034..6614f66 100644
--- a/app/models/pdfresource.rb
+++ b/app/models/pdfresource.rb
@@ -1,4 +1,7 @@
class Pdfresource < ApplicationRecord
has_many_attached :pdfs
has_many_attached :thumbnails
+ validates :feature_slot,
+ numericality: { only_integer: true, greater_than_or_equal_to: 1, less_than_or_equal_to: 3, allow_nil: true },
+ allow_nil: true
end