Skip to content

The 'localKey' of the 'belongsTo' relation ship is not set. #251

@wewei

Description

@wewei

Hi, I found js-data has a inconsistent behavior about populating the localKey/foreignKey on injecting.
When injecting an entity together with its belongsTo entity, the localKey is not set correctly. This behavior is inconsistent with that of hasMany relationships.
Refer to this test code for detail.
http://codepen.io/wewei/pen/yYvvVP?editors=001

Not sure if it's on purpose or not. Even it's by design, it behavior still looks buggy. It feels more natural to always populate the localKey/foreignKey on cascading creation.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions