diff options
author | Andreas Scherer <andreas_coder@freenet.de> | 2009-02-12 09:09:57 +0100 |
---|---|---|
committer | Andreas Scherer <andreas_coder@freenet.de> | 2009-02-12 09:09:57 +0100 |
commit | d7a5db2885bbc442b238ef80f793892ad473d7b5 (patch) | |
tree | 2c6e433651f76b049ded9c57f8ed90a8e8084dc2 /railties/guides | |
parent | 115f352deb0803b427cd334fde549c39df7b4d32 (diff) | |
download | rails-d7a5db2885bbc442b238ef80f793892ad473d7b5.tar.gz rails-d7a5db2885bbc442b238ef80f793892ad473d7b5.tar.bz2 rails-d7a5db2885bbc442b238ef80f793892ad473d7b5.zip |
Use ndash for numerical relations.
Diffstat (limited to 'railties/guides')
-rw-r--r-- | railties/guides/source/association_basics.textile | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/guides/source/association_basics.textile b/railties/guides/source/association_basics.textile index f98a7fec63..630274a2b8 100644 --- a/railties/guides/source/association_basics.textile +++ b/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 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? 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: |