You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sqm-dashboards/app/models/category.rb

12 lines
246 B

# 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