Skip to content

Instantly share code, notes, and snippets.

@ugisozols
Created June 4, 2010 05:57
Show Gist options
  • Save ugisozols/425026 to your computer and use it in GitHub Desktop.
Save ugisozols/425026 to your computer and use it in GitHub Desktop.
script/generate scaffold company title:string
script/generate scaffold address company_id:integer address:text
script/generate scaffold employee company_id:integer name:string surname:string
# company model
class Company < ActiveRecord::Base
has_one :address
has_many :employees
end
# address model
class Address < ActiveRecord::Base
belongs_to :company
end
# employee model
class Employee < ActiveRecord::Base
belongs_to :company
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment