From 5a9063a04b5a81de31566ad641728ca06fe96927 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Wed, 13 Nov 2024 17:12:14 +0000 Subject: Adds some validation and further work on the form --- app/models/pdfresource.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app/models') 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 -- cgit v1.2.3