Generate fetched results controllers for to-many relationships #88

Merged
merged 6 commits into from Jan 25, 2012

Projects

None yet

2 participants

@danielctull

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 danielctull Generate fetched results controllers for to-many relationships
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.
99ec596
@danielctull

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
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

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

@danielctull

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

@rentzsch rentzsch merged commit c0a0ba4 into rentzsch:master Jan 25, 2012
@rentzsch
Owner

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

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