Skip to content
Browse files

Updated [ci skip]

Updated to include how to write migrations for self joins


Corrected the update


Typo fix

Changed :employee to :manager
  • Loading branch information...
1 parent b0a8ef1 commit 464d47eaaf76995ae8eaa5205d250ff859fed795 @rohitpaulk rohitpaulk committed
Showing with 13 additions and 0 deletions.
  1. +13 −0 guides/source/
13 guides/source/
@@ -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.
+class CreateEmployees < ActiveRecord::Migration
+ def change
+ create_table :employees do |t|
+ t.references :manager
+ t.timestamps
+ end
+ end
Tips, Tricks, and Warnings

0 comments on commit 464d47e

Please sign in to comment.
Something went wrong with that request. Please try again.