mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-09 07:28:41 -07:00
adding slugs to schools and categories
This commit is contained in:
parent
683fc31c5d
commit
1db61cd3e5
13 changed files with 42 additions and 12 deletions
|
|
@ -9,6 +9,9 @@ class Category < ApplicationRecord
|
|||
|
||||
scope :for_parent, -> (category=nil) { where(parent_category_id: category.try(:id)) }
|
||||
|
||||
include FriendlyId
|
||||
friendly_id :name, :use => [:slugged]
|
||||
|
||||
def path
|
||||
p = self
|
||||
items = [p]
|
||||
|
|
|
|||
|
|
@ -7,4 +7,7 @@ class School < ApplicationRecord
|
|||
|
||||
validates :name, presence: true
|
||||
|
||||
include FriendlyId
|
||||
friendly_id :name, :use => [:slugged]
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue