Generate fetched results controllers for to-many relationships #88

Merged
merged 6 commits into from Jan 25, 2012

Conversation

Projects
None yet
2 participants
@danielctull
Contributor

danielctull commented Jan 24, 2012

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.

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.
@danielctull

This comment has been minimized.

Show comment
Hide comment
@danielctull

danielctull Jan 24, 2012

Contributor

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.

Contributor

danielctull commented Jan 24, 2012

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

This comment has been minimized.

Show comment
Hide comment
@rentzsch

rentzsch Jan 25, 2012

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.

Owner

rentzsch commented Jan 25, 2012

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

This comment has been minimized.

Show comment
Hide comment
@danielctull

danielctull Jan 25, 2012

Contributor

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

Contributor

danielctull commented Jan 25, 2012

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

@danielctull

This comment has been minimized.

Show comment
Hide comment
@danielctull

danielctull Jan 25, 2012

Contributor

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

Contributor

danielctull commented Jan 25, 2012

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

Merge pull request #88 from danielctull/feature/FetchedResultsControl…
…lerMethods

[NEW] Generate fetched results controllers for to-many relationships. (Daniel Tull)

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

@rentzsch

This comment has been minimized.

Show comment
Hide comment
@rentzsch

rentzsch Jan 25, 2012

Owner

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

Owner

rentzsch commented Jan 25, 2012

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

Merge pull request #88 from danielctull/feature/FetchedResultsControl…
…lerMethods

[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