From 3f7ed52d3b0cdb31c355b142f9ac7526685a7049 Mon Sep 17 00:00:00 2001
From: Mikhail Dieterle <MikDiet@gmail.com>
Date: Fri, 23 Mar 2012 18:30:16 +0800
Subject: :foreign_key option should be on has_many side of association

---
 railties/guides/source/association_basics.textile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'railties/guides/source/association_basics.textile')

diff --git a/railties/guides/source/association_basics.textile b/railties/guides/source/association_basics.textile
index 6f0d985cac..ceb4862ff5 100644
--- a/railties/guides/source/association_basics.textile
+++ b/railties/guides/source/association_basics.textile
@@ -342,9 +342,9 @@ In designing a data model, you will sometimes find a model that should have a re
 
 <ruby>
 class Employee < ActiveRecord::Base
-  has_many :subordinates, :class_name => "Employee"
-  belongs_to :manager, :class_name => "Employee",
+  has_many :subordinates, :class_name => "Employee",
     :foreign_key => "manager_id"
+  belongs_to :manager, :class_name => "Employee"
 end
 </ruby>
 
-- 
cgit v1.2.3

