Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

:foreign_key option should be on has_many side of association

  • Loading branch information...
commit 44ef59f40baaa1b776248727e23452b25d69fa1d 1 parent 65a3020
@Mik-die Mik-die authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 guides/source/association_basics.textile
View
4 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>
Please sign in to comment.
Something went wrong with that request. Please try again.