diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-01-31 04:06:56 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-01-31 04:06:56 -0800 |
commit | f484df79f26bca7e952f907878074eddbf72656d (patch) | |
tree | 3f5f631f8951ff05f59ec954dd01324d6d89a357 /guides/source/association_basics.md | |
parent | 8c7e8b4f18a18ee616e5351f8fa3581cdee79e23 (diff) | |
parent | 464d47eaaf76995ae8eaa5205d250ff859fed795 (diff) | |
download | rails-f484df79f26bca7e952f907878074eddbf72656d.tar.gz rails-f484df79f26bca7e952f907878074eddbf72656d.tar.bz2 rails-f484df79f26bca7e952f907878074eddbf72656d.zip |
Merge pull request #13780 from rohitpaulk/patch-1
Updated association_basics.md
Diffstat (limited to 'guides/source/association_basics.md')
-rw-r--r-- | guides/source/association_basics.md | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/guides/source/association_basics.md b/guides/source/association_basics.md index 9867d2dc3f..5ec6ae0f21 100644 --- a/guides/source/association_basics.md +++ b/guides/source/association_basics.md @@ -490,6 +490,19 @@ end With this setup, you can retrieve `@employee.subordinates` and `@employee.manager`. +In your migrations/schema, you will add a references column to the model itself. + +```ruby +class CreateEmployees < ActiveRecord::Migration + def change + create_table :employees do |t| + t.references :manager + t.timestamps + end + end +end +``` + Tips, Tricks, and Warnings -------------------------- |