sqm-dashboards/app/models/category.rb

11 lines
246 B
Ruby

# frozen_string_literal: true
class Category < ActiveRecord::Base
include FriendlyId
friendly_id :name, use: [:slugged]
scope :sorted, -> { order(:sort_index) }
has_many :subcategories
has_many :measures, through: :subcategories
end