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.
18 lines
341 B
18 lines
341 B
module Dashboard
|
|
class District < ApplicationRecord
|
|
has_many :schools, class_name: "School", foreign_key: :id
|
|
|
|
validates :name, presence: true
|
|
|
|
scope :alphabetic, -> { order(name: :asc) }
|
|
|
|
include FriendlyId
|
|
|
|
friendly_id :name, use: [:slugged]
|
|
|
|
def short_name
|
|
name.split(" ").first.downcase
|
|
end
|
|
end
|
|
end
|