paulw11 / Seam3

Cloudkit based persistent store for Core Data
Other
209 stars 25 forks source link

Compatibility for core data models using super entities / sub entities #42

Closed tifroz closed 7 years ago

tifroz commented 7 years ago

Checking for existence of a superentity before adding extra attributes (adding the attributes to both the superentity and its subentities causes errors because the model sees object that has 2 attributes with conflicting -i.e. identical- names)

tifroz commented 7 years ago

Errr...nevermind!! This pull request does prevent some errors with models that make use of super-entities / sub-entities, but at the end of the day it achieves nothing because models that use entity inheritance don't sync'd correctly: the sub-entities' attributes are ignored during the sync (only the super-entity's attributes are sync'd).

I will look into it, I may submit a more complete pull request later depending on what I find out.

tifroz commented 7 years ago

Long day. After further digging it turns out that my sub-entity attributes are not being sync'd because they are of type Transformable (it has nothing to do with sub-entity Vs super-entity) - so the pull request does make sense, it makes Seam3 compatible with models that use inheritance.

Next I'll be looking at adding at least partial support for Transformable attributes - unless there is a reason this shouldn't be done (let me know)?

tifroz commented 7 years ago

I committed the change to my cloned repository - it looks like I don't need to create another pull request...let me know otherwise!

tifroz commented 7 years ago

Ugh...I committed additional changes to support Transformable Core Data attributes, thinking I would generate a separate pull request for this particular topic - but I think everything made it into the current pull request.

So, here is the new summary for this pull request:

• Adds support for Core Data models that make use of inheritance (super-entities / sub-entities) • Adds partial support for Transformable Core Data attributes (support is restricted to attributes that use the default transformer, e.g. NScoder)

paulw11 commented 7 years ago

Yes, once you have a pull request open, any additional commits are added to that request. You can create a new branch for your Transformable code and then revert those commits from master if you want to keep it separate, then once you are ready you can merge your new branch back into master and submit another PR.

Or we can just include what you have so far if it is ready; it at least offers some support for Transformable

tifroz commented 7 years ago

Yes, all the changes I pushed are unit-tested and ready to go - thank you for merging!