rentzsch / mogenerator

Core Data code generation

Home Page:http://rentzsch.github.com/mogenerator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

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