Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use ndash for numerical relations.

  • Loading branch information...
commit d7a5db2885bbc442b238ef80f793892ad473d7b5 1 parent 115f352
Andreas Scherer authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  railties/guides/source/association_basics.textile
View
2  railties/guides/source/association_basics.textile
@@ -195,7 +195,7 @@ end
h4. Choosing Between belongs_to and has_one
-If you want to set up a 1-1 relationship between two models, you'll need to add +belongs_to+ to one, and +has_one+ to the other. How do you know which is which?
+If you want to set up a 11 relationship between two models, you'll need to add +belongs_to+ to one, and +has_one+ to the other. How do you know which is which?
The distinction is in where you place the foreign key (it goes on the table for the class declaring the +belongs_to+ association), but you should give some thought to the actual meaning of the data as well. The +has_one+ relationship says that one of something is yours - that is, that something points back to you. For example, it makes more sense to say that a supplier owns an account than that an account owns a supplier. This suggests that the correct relationships are like this:
Please sign in to comment.
Something went wrong with that request. Please try again.