mirror of
https://github.com/edcommonwealth/Dashboard.git
synced 2026-03-07 21:38:14 -08:00
13 lines
347 B
Ruby
13 lines
347 B
Ruby
module Dashboard
|
|
class Category < ApplicationRecord
|
|
include FriendlyId
|
|
friendly_id :name, use: [:slugged]
|
|
|
|
scope :sorted, -> { order(:category_id) }
|
|
|
|
has_many :subcategories
|
|
has_many :measures, through: :subcategories
|
|
has_many :admin_data_items, through: :measures
|
|
has_many :scales, through: :subcategories
|
|
end
|
|
end
|