diff options
author | Matthew Lemon <y@yulqen.org> | 2024-11-14 15:47:43 +0000 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-11-14 15:47:43 +0000 |
commit | 6427b28c60c6ed0dfd637307d1ab4ffe65c1144d (patch) | |
tree | 156d280b94557f9606c053f6187aec2a21eb1b36 /app/models | |
parent | 1b64b0b709c5704de48120e20bdfad32f34b0b5d (diff) |
Adds ResourceType model
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/pdfresource.rb | 1 | ||||
-rw-r--r-- | app/models/resource_type.rb | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/app/models/pdfresource.rb b/app/models/pdfresource.rb index 86e600c..4fa2292 100644 --- a/app/models/pdfresource.rb +++ b/app/models/pdfresource.rb @@ -2,6 +2,7 @@ class Pdfresource < ApplicationRecord has_many_attached :pdfs has_many_attached :thumbnails 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 }, allow_nil: true diff --git a/app/models/resource_type.rb b/app/models/resource_type.rb new file mode 100644 index 0000000..066a734 --- /dev/null +++ b/app/models/resource_type.rb @@ -0,0 +1,3 @@ +class ResourceType < ApplicationRecord + has_many :pdfresources +end |