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

  acts_as_list column: :rank, scope: :category

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