Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mogen crashes on fetchrequests with keypaths #139

Closed
tychop opened this issue Nov 30, 2012 · 6 comments
Closed

Mogen crashes on fetchrequests with keypaths #139

tychop opened this issue Nov 30, 2012 · 6 comments

Comments

@tychop
Copy link

tychop commented Nov 30, 2012

I get the following error after defining a fetch request with a keypath:

Assertion failed: (relationship), function -[NSEntityDescription(customBaseClass) _resolveKeyPathType:], file /Users/wolf/code/github/mogenerator/mogenerator.m, line 182.

It only happens when I have a fetch request with an expression using keypaths: "repository.name == $repositoryName"

@BlackBears
Copy link

Same here. Same assertion; same conditions.

@rentzsch
Copy link
Owner

Thanks, this is a known issue. Just waiting for someone to offer a pull request with a new passing test. See #114 for starters, but that's old enough that it can't be cleanly merged and will need to be reworked.

@rentzsch
Copy link
Owner

@halmueller
Copy link

What's the behavior you would like to see, in mogenerator and in the test cases?

I have a couple of fetch requests that trigger this assertion. My workaround is to remove them before running mogenerator, and then restore them. Yuk.

In a perfect world, mogenerator would generate the correct fetch methods for these requests. But I'd be very happy if they were simply skipped, so that the rest of the data model could be processed. Throwing an exception and quitting is the worst of all worlds IMO--I'd much rather see a warning, or even some boilerplate code in _FooMO.m that throws an exception, begging an override in FooMO.m.

Are you looking for mods to the test cases which simply provide a failing fetch request? A fullblown fix? Would you consider something in between?

@rentzsch
Copy link
Owner

I'd be fine with a ignoring offending fetch requests with a warning for now, until someone adds full support.

I liked the assert since it made apparent Something's Not Right. A warning accomplishes the same thing but would avoid your icky remove-offending-fetch-requests-mogen-then-re-add dance.

@rentzsch
Copy link
Owner

Duplicate of #15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants