aboutsummaryrefslogtreecommitdiff
path: root/app/models/section.rb
blob: 7d26882f71aebe03110d83977d0d4df36a4e1be6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
class Section < ApplicationRecord
  belongs_to :category
  has_one :taxonomy, through: :category
  has_many :classifications
  has_many :resources, through: :classifications

  acts_as_list column: :rank, scope: :category

  validates :name,
            uniqueness: { scope: :category_id },
            length: { in: 3..64 }
end