From 1062c6328f60bf9cacba20c07f5cd33e55c153ee Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Thu, 14 Nov 2024 11:12:36 +0000 Subject: Adds credits to resource and required asterisks on form --- app/models/pdfresource.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/models') diff --git a/app/models/pdfresource.rb b/app/models/pdfresource.rb index a5ef56d..86e600c 100644 --- a/app/models/pdfresource.rb +++ b/app/models/pdfresource.rb @@ -6,7 +6,8 @@ class Pdfresource < ApplicationRecord numericality: { only_integer: true, greater_than_or_equal_to: 1, less_than_or_equal_to: 3, allow_nil: true }, allow_nil: true validate :validate_pdf_count - validates :name, :thumbnails, presence: true + validates :name, :thumbnails, :description, :card_description, :pdfs, :credits, presence: true + def validate_pdf_count if pdfs.size > 10 -- cgit v1.2.3