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

Versioned model doesn't work with only one version #137

Closed
sixten opened this issue Nov 19, 2012 · 6 comments · Fixed by #138
Closed

Versioned model doesn't work with only one version #137

sixten opened this issue Nov 19, 2012 · 6 comments · Fixed by #138

Comments

@sixten
Copy link
Contributor

sixten commented Nov 19, 2012

Support was added in #102 and released in version 1.27 for passing a versioned model directory as the --model argument to mogenerator. It appears to miss one edge case: it's possible for a newly-created versioned model (with exactly one model version inside of it) to lack a .xccurrentversion file.

In Xcode 4.5.2, at least, new models are created in that state. And while the File Inspector does display a menu to select the current model version, selecting the one option available does not cause it to create the marker file.

I'd suggest perhaps that in the case where a versioned model is specified, and the current version file does not exist, that mogenerator count the number of *.xcdatamodel items are in that directory. If there's exactly one, then the choice is pretty clear. If there are more (or zero), then execution should halt as it does now.

@rentzsch
Copy link
Owner

Thanks for the bug report. I like your solution, can I sweet-talk you into writing it?

@sixten
Copy link
Contributor Author

sixten commented Nov 20, 2012

Hah! Yeah, I'd be happy to take a stab at a patch, but I won't have time until the weekend at the earliest. Wanted to get the issue in before I lost the plot entirely.

On Nov 19, 2012, at 5:59 PM, rentzsch [email protected] wrote:

Thanks for the bug report. I like your solution, can I sweet-talk you into writing it?


Reply to this email directly or view it on GitHub.

@rentzsch
Copy link
Owner

@sixten in case you didn't notice, @Sagran already did your dirty work

@sixten
Copy link
Contributor Author

sixten commented Nov 20, 2012

Sweet. Even better! Thanks, @Sagran!

@sgrankin
Copy link
Contributor

No problem. Actually ran into this, fixed it, and was surprised to find somebody else had run into this an hour before I did. :D

On Nov 19, 2012, at 20:25, Sixten Otto [email protected] wrote:

Sweet. Even better! Thanks, @Sagran!


Reply to this email directly or view it on GitHub.

@SergioEstevao
Copy link

Is there an official release with this code merged in?

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 a pull request may close this issue.

4 participants