diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/pdfresource.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/pdfresource.rb b/app/models/pdfresource.rb index 4fa2292..8e59972 100644 --- a/app/models/pdfresource.rb +++ b/app/models/pdfresource.rb @@ -4,7 +4,8 @@ class Pdfresource < ApplicationRecord has_many_attached :pdf_snapshots belongs_to :resource_type validates :feature_slot, - numericality: { only_integer: true, greater_than_or_equal_to: 1, less_than_or_equal_to: 3, allow_nil: true }, + inclusion: { in: [ 1, 2, 3 ], message: "must be 1, 2, or 3" }, + uniqueness: { message: "is already taken by another featured resource" }, allow_nil: true validate :validate_pdf_count validates :name, :thumbnails, :description, :card_description, :pdfs, :credits, presence: true |