From 2022831d4960054aef904e27fd2934beb4e3c65e Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Thu, 14 Nov 2024 17:16:43 +0000 Subject: Adds category model but not wired up to resource yet --- app/models/category.rb | 3 +++ app/models/resource_type.rb | 1 + 2 files changed, 4 insertions(+) create mode 100644 app/models/category.rb (limited to 'app/models') diff --git a/app/models/category.rb b/app/models/category.rb new file mode 100644 index 0000000..296e7d6 --- /dev/null +++ b/app/models/category.rb @@ -0,0 +1,3 @@ +class Category < ApplicationRecord + validates :name, presence: true, uniqueness: true +end diff --git a/app/models/resource_type.rb b/app/models/resource_type.rb index 066a734..414e71e 100644 --- a/app/models/resource_type.rb +++ b/app/models/resource_type.rb @@ -1,3 +1,4 @@ class ResourceType < ApplicationRecord has_many :pdfresources + validates :name, presence: true, uniqueness: true end -- cgit v1.2.3