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

Correct generation of fetch requests with repeated variables #125

Merged
merged 2 commits into from
Aug 17, 2012

Conversation

winitzki
Copy link

If a CoreData model has a fetch request with a predicate where some variables are repeated, mogenerator will now generate correct Objective-C code.

Example: Suppose a CoreData model has a fetch request with predicate (name==$NAME AND id==$ID ) OR ( surname==$NAME AND id="special"). In this predicate, the variable $NAME is mentioned twice. The current version of mogenerator exports such a fetch request as a function with declaration of this form,

  • (NSArray_)fetchGetWhatever:(NSManagedObjectContext_)moc_ NAME:(NSString*)NAME_ ID:(NSString *)ID_ NAME:(NSString *)NAME_;

This does not compile since the parameter "NAME_" is used twice.

My patch corrects this problem and makes sure that variables are used only once.

@rentzsch
Copy link
Owner

Hi Sergei,

Looks good. Could you remove the // changes by lines before I merge this? The diffs already do a good job of highlighting differences, your name is already on the commit and I promise to give you credit in the release notes :-)

@winitzki
Copy link
Author

Hi Jonathan,

yes, I just removed these comments and pushed the change to my repo. This is my first time with github/forking and I was not sure how to make clear where the changes are.

Regards,
Sergei

On Aug 16, 2012, at 11:34 PM, Jonathan 'Wolf' Rentzsch wrote:

Hi Sergei,

Looks good. Could you remove the // changes by lines before I merge this? The diffs already do a good job of highlighting differences, your name is already on the commit and I promise to give you credit in the release notes :-)


Reply to this email directly or view it on GitHub.

@rentzsch
Copy link
Owner

Well then I'm glad I held your hand a little through the process. Welcome to forking :) Pulled.

rentzsch added a commit that referenced this pull request Aug 17, 2012
[FIX] Correct generation of fetch requests with repeated variables. (Sergei Winitzki)
@rentzsch rentzsch merged commit 4334e67 into rentzsch:master Aug 17, 2012
ddrccw pushed a commit to ddrccw/mogenerator that referenced this pull request Jan 20, 2014
[FIX] Correct generation of fetch requests with repeated variables. (Sergei Winitzki)
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.

2 participants