mirror of
https://github.com/edcommonwealth/Dashboard.git
synced 2026-03-15 01:35:54 -07:00
dirty commit: can't get references to work correctly between any tables
This commit is contained in:
parent
e1f0b78236
commit
a4fddbeced
183 changed files with 5461 additions and 5 deletions
13
app/models/dashboard/category.rb
Normal file
13
app/models/dashboard/category.rb
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue