Supports subclassing Entities to an arbitrary depth, and on relationship entities#52
Supports subclassing Entities to an arbitrary depth, and on relationship entities#52cnstoll merged 3 commits intomutualmobile:masterfrom iandundas:master
Conversation
find the most specific subclass to use. Also now supports subclasses on an entity with a relationship to the primary entity, e.g. en "[Tree]-<[Apples]", each Apple subclass is (recursively) queried to determine what type of Apple it is.
|
This is looking pretty good. I want to test it out a bit more. It did pass all of my private tests related to other projects, but I did notice a small problem in another project which DOES actually use sub entities. I want to dig into that problem a bit more before this gets merged. I think that issue may be unrelated, but I want to make sure. For now I'm gonna make a few general style comments that you can address while I look into that some more. Thanks! |
Source/MMRecord/MMRecordResponse.m
Outdated
There was a problem hiding this comment.
Just remove this line. Its part of the private interface so we don't need to add it to the class extension here.
|
Thanks for feedback, I'll make the changes now :) |
|
I tested this out again with a bit more rigor. I can't reproduce the issue I was seeing, and I think it was most likely related to a bad build. I specifically looked at a project that was using a 1-level depth of sub entities and that is still behaving correctly. I think this looks good to go once the style comments are addressed. Thanks again! |
|
Cool, I've pushed those changes now. Hope it helps! :) |
Supports subclassing Entities to an arbitrary depth, and on relationship entities
|
There were 1 or 2 white spacing things, but I just fixed them manually. Didn't feel like thrashing on those :) Thanks again for the PR! |
nb: first of all, apologies for the white-space deletions, my IDE cleaned them up. I can resubmit without, if that's much easier.
I extended the extent to which MMRecord detects and uses Entity subclasses ( i.e. when it queries
shouldUseSubEntityRecordClassToRepresentData). It now supports beyond a single level of subclassing (i.e. it checks recursively), and also allows relationship entities to be matched to a subclass as well, as in this example:A: it will now support Account subclassing for the following example:
Feedback is very welcome