You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Documentation for hasMany and belongsTo is unclear #10860
What was unclear/insufficient/not covered in the documentation
In the documentation the Associations tab has a section labeled Difference between HasOne and BelongsTo, and it is clear about the the difference between the two when it states
HasOne and BelongsTo insert the association key in different models from each other. HasOne inserts the association key in target model whereas BelongsTo inserts the association key in the source model.
That explanation makes sense, but the example makes it really unclear as to what is going on when we are presented with this example:
If the two do the same thing, but insert the keys to the other table in different ways, then why would we want to define this relationship twice? It is confusing, and a reader cannot get a sufficient understanding about why we are given this example, and it is used repeatedly throughout the documentation.
If possible: Provide some suggestion how we can enhance the docs
Since the documentation is unclear the reader needs to then go to stack overflow to find the answer, and hopefully they find this question, and then read the second provided answer, which explains it perfectly.
Thank you
Reacted by Eric, bullsei, Ras Abdoellah and Pedro Augusto de Paula Barbosa
Activity