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

Generate fetched results controllers for to-many relationships #88

Merged
merged 6 commits into from
Jan 25, 2012
Merged

Generate fetched results controllers for to-many relationships #88

merged 6 commits into from
Jan 25, 2012

Conversation

danielctull
Copy link
Contributor

This are generated when frc=true is used as a template variable.

The cache name is generated from a combination of the entity name, indexed attributes, relationship name and sort descriptors to try to make it unique.

If there are no indexed attributes, the cache name is nil because using different fetch requests with the same cache name completely borks the fetched results controller.

This are generated when `frc=true` is used as a template variable.

The cache name is generated from a combination of the entity name, indexed attributes, relationship name and sort descriptors to try to make it unique.

If there are no indexed attributes, the cache name is nil because using different fetch requests with the same cache name completely borks the fetched results controller.
@danielctull
Copy link
Contributor Author

Is there a way within the template to count the number of attributes that are indexed? This will allow the template to know whether it can generate a cache name or not rather than putting that logic in the generated code.

@rentzsch
Copy link
Owner

Thanks man

Is there a way within the template to count the number of attributes that are indexed?

I don't think that's possible within the template, but would be easy to add a category in mogenerator.m that the template could read.

Let me know if you want to tackle the category or if you just want me to pull this right now.

@danielctull
Copy link
Contributor Author

I'll take a look into the category. :)

@danielctull
Copy link
Contributor Author

If everyone can look past my stupidity for a second there, this now produces nice clean output. :)

rentzsch added a commit that referenced this pull request Jan 25, 2012
…lerMethods

[NEW] Generate fetched results controllers for to-many relationships. (Daniel Tull)
@rentzsch rentzsch merged commit c0a0ba4 into rentzsch:master Jan 25, 2012
@rentzsch
Copy link
Owner

That's exactly what I was looking for, thanks! Pulled.

ddrccw pushed a commit to ddrccw/mogenerator that referenced this pull request Jan 20, 2014
…sControllerMethods

[NEW] Generate fetched results controllers for to-many relationships. (Daniel Tull)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants