failed assertion 'relationship': fetch requests with substitution variables
lawrencelomax opened this issue · comments
Hi,
I'm having an issue with using fetch requests causing mogenerator to present the following error:
mogenerator -m ./Resources/DataModel.xcdatamodel/ -O ./Classes/Managed\ Objects/
/Users/wolf/code/github/mogenerator/mogenerator.m:80: failed assertion `relationship'
Abort trap
This seems to come down to creating a fetch request that uses substitution variables in combination with a request that gets the LHS from a relationship. So this causes mogenerator to fail: user.username == $username, wheras this does not requestIdentifier == $request_identifier. I'm not too good at explaining technical details so I have uploaded a screencast so you can see what I am on about. The screencast is available here: files.me.com/insertjokehere/qa9jg7.mov
This issue is a stopper for me.
It is very common to have fetch request with variables in the model.
I think this was fixed in 1.16? http://github.com/rentzsch/mogenerator/commit/6bd8051a70d32fe73c1965cb449d2f40d403260a
Jonathan
In my case it is still failing. I just download latest version (1.18) and create simple model with 2 tables:
$ mogenerator --version
mogenerator 1.18. By Jonathan 'Wolf' Rentzsch + friends.
$ mogenerator -m DATA.xcdatamodel -M machine -H myclasses
/Users/wolf/code/github/mogenerator/mogenerator.m:137: failed assertion `relationship'
Abort trap
The tar file with model can be download from: http://www.zdima.net/downloads/model.tar
Let me know if there is something in the data model that I am not suppose to do, otherwise the issue seems to be exist.
Thanks
Ah, thanks for the data. Yeah, that's a known TODO:
https://github.com/rentzsch/mogenerator/blob/master/mogenerator.m#L163
I don't need this feature yet, do want to tackle implementing it?
Looks like duplicated as #81
Duplicated as #124
#33 asks for better error reporting
Dup'd as #139
Dup'd as #81
Dup'd as #114
Dup'd as #92