Skip to content

Instantly share code, notes, and snippets.

@gogogarrett
Created June 7, 2014 04:26
Show Gist options
  • Save gogogarrett/d96cea8c45670760fc58 to your computer and use it in GitHub Desktop.
Save gogogarrett/d96cea8c45670760fc58 to your computer and use it in GitHub Desktop.
class School < ActiveRecord::Base
has_many :students
has_many :teachers
def to_param
"#{id}-#{name.parameterize}"
end
def to_s
name
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment