Description: - HasOne docs problem.
just check RC1 docs (not online docs) even when applies since 4.1 beta.
hasOne docs are describing the same thing as a belongsTo association. check the docs for both associations and ull see they are describing the same thing.
hasOne is not the same as belongsTo.
hasOne rc1 docs says "The owner model is expected to have a foreign key which references the primary key of the associated model"
and should say "The associated model is expected to have a foreign key which references the primary key of the owner model"
if this needs more detailed explanation just tell and ill explain but i think anyone that knows bout associations will understand this.
their diference is "where the foreign key is placed".
and anyway current hasOne is describing the same as belongsTo so if that were correct not point to have a hasOne association.
this correction is important because helps to understand what its implemented.
- hasOne source code problem
setter is doing the same thing as belongsTo does, i guess because is trying to implement what docs says, but after you check docs are wrong then the implementation needs to change.
but its not just the documentation, and documentation actually is not the important part, doesnt matter is docs are wrong if code works fine, hasOne source code is doing what a belongsTo has to do, hasOne is not really implemented.
So the problem between hasOne and belongsTo will not be resolved? I think dedoz has a point. At this point hasOne and belongsTo are the same, but they should differ and their docs should be updated accordingly. And there is matter of wheter to use hasOne or use hasMany istead?