diff options
author | Sasha Gerrand <sasha@returnity.com> | 2011-05-09 12:20:44 +1000 |
---|---|---|
committer | Sasha Gerrand <sasha@returnity.com> | 2011-05-09 12:20:44 +1000 |
commit | fda9c7d0c872fcb75e24ae8479bb6c0a34d65e70 (patch) | |
tree | ec5086572e9920e24d0ee0154c78994c89a655a1 /railties/guides | |
parent | d6ff2eea0b66df825105aa7b74a32db7fd3db8b9 (diff) | |
download | rails-fda9c7d0c872fcb75e24ae8479bb6c0a34d65e70.tar.gz rails-fda9c7d0c872fcb75e24ae8479bb6c0a34d65e70.tar.bz2 rails-fda9c7d0c872fcb75e24ae8479bb6c0a34d65e70.zip |
- Moved foreign key parameter to correct location for self join on a model example
Diffstat (limited to 'railties/guides')
-rw-r--r-- | railties/guides/source/association_basics.textile | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/guides/source/association_basics.textile b/railties/guides/source/association_basics.textile index 94dce1b97b..43babb8b52 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", - :foreign_key => "manager_id" + has_many :subordinates, :class_name => "Employee" belongs_to :manager, :class_name => "Employee" + :foreign_key => "manager_id" end </ruby> |