diff options
Diffstat (limited to 'app/models/section.rb')
-rw-r--r-- | app/models/section.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/section.rb b/app/models/section.rb index 6cfeb38..7d26882 100644 --- a/app/models/section.rb +++ b/app/models/section.rb @@ -1,11 +1,12 @@ class Section < ApplicationRecord belongs_to :category has_one :taxonomy, through: :category - has_and_belongs_to_many :resources + has_many :classifications + has_many :resources, through: :classifications acts_as_list column: :rank, scope: :category validates :name, uniqueness: { scope: :category_id }, - length: 3..64 + length: { in: 3..64 } end |