This project is archived and is in readonly mode.
One-to-one Association example at docs is confused
-
Carlos Paramio
s/confused/confusing/ ;-)
-
Carlos Paramio
- Tag changed from activerecord, belongs_to, doc, documentation, has_one to activerecord, belongs_to, doc, documentation, has_one, patch
I used "git diff" to create the patch, but checking the documentation, it seems that the preferred format is the output of "git format-patch", so I've included the new patch file that substitutes the first one, with extension ".diff" as it appears at the contributions guide. My apologize for any inconvenience.
-
Josh Susser
-1
has_one vs belongs_to is always going to be a matter of perspective. There's no point in making this change because the new example will be just as confusing to just as many people as the current one is. And what if an employee works in multiple offices? The only "real world" mapping that works is many-to-many. Can we leave this contrived example alone?
If this mapping needs to be discussed further, it should be about how the location of the foreign key impacts database performance and application architecture. But that's beyond the scope of this section.
-
DHH
- State changed from new to wontfix
I agree with Josh. But don't let that stop you from keeping at improving Rails documentation. Thanks for being interested in helping.
-
CancelProfileIsBroken
In addition, we have http://guides.rubyonrails.org/as... for more details on associations. Feel free to submit a patch in the docrails project if you think the coverage there can be improved.
-
Carlos Paramio
Good point. I just saw more natural the reversed case (maybe because it could be more common), but it's true that the example won't be like "real world" in any case. Thanks for your comments!
