wvteijlingen / Spine

A Swift library for working with JSON:API APIs. It supports mapping to custom model classes, fetching, advanced querying, linking and persisting.
MIT License
266 stars 109 forks source link

Relationship field `readOnly` specifier not honoured #123

Closed markst closed 7 years ago

markst commented 7 years ago

If defining my relationship attribute as readOnly ToOneRelationship(Session.self).readOnly() The SaveOperation will still attempt to update relationships.

markst commented 7 years ago

Related to #99

OliverDobner-flinc commented 7 years ago

@markst There is a 'dirty-checking' branch I contributed to, so if there are no changes there will be no update request. This might be suitable for you?! wvteijlingen promised to merge this branch to master in near future.

wvteijlingen commented 7 years ago

Dirty checking will probably solve this, but read only fields shouldn't be saved ever. So this is most likely a bug that needs to be solved. Thanks for reporting!

wvteijlingen commented 7 years ago

I updated this in master.

markst commented 7 years ago

Awesome!