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

  acts_as_list column: :rank, scope: :category

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