# == Schema Information
#
# Table name: licenses
#
#  id         :integer          not null, primary key
#  name       :string(255)
#  content    :text(65535)
#  created_at :datetime         not null
#  updated_at :datetime         not null
#  position   :integer          default("0")
#

class License < ApplicationRecord
  default_scope { order(position: :desc) }

  include Projectable
  has_many :attachments, as: :container, dependent: :destroy

  validates :name, :content, presence: true
  validates :name, uniqueness: { case_sensitive: false }

end
