Exception for missing relatedByAttribute. #263

wants to merge 1 commit into


None yet
5 participants

Re: issue #253 "importFromArray crashes when no relatedByAttribute is set"

Friendly exception with entity name. Not sure if I should be using MRLog().

Throw exception for missing relatedByAttribute
Re: issue #253 "importFromArray crashes when no relatedByAttribute is set"

userInfo is a variable name :)


aaronpeterson replied Sep 28, 2012

Do you mean instead Xcode's UI label "User Info"?

Are you saying it's not worded correctly @casademora?

it's not that big a deal. I think while Xcode's User Info label is fine, that's great if you speak english. I'm not sure if Xcode is localized, but userInfo, the variable name, will always be the same...personally, I prefer to reference code in a developer specific error message than labels.

It's a minor thing, no big deal either way. This will be helpful to many people regardless! Thanks for contributing!

I assume we only wan't this behavior in debug mode? NSAsserts will be compiled out for release, but that may be the desired behavior. Do we want a MRLog in addition for when the assert is disabled?

@casademora I agree that it should be userInfo.

gaku commented May 19, 2013

I encountered the same problem and @aaronpeterson 's pull request could have saved my debugging. I'd love to see this pull request merged!


tonyarnold commented Dec 24, 2013

I've been looking to merge this PR in for the last couple of days, but it needs more thought — not all imported objects will have relationships, and not all imported objects will have a primary key. You can see an example of this by running the unit tests living in develop now with your change in place.

Yeah I still don't know why it wasn't merged.


tonyarnold commented Dec 27, 2013

Basically because the change breaks the test suite, and I’m trying to find a way to provide the ‘safety’ of the assertion without breaking relationships that don’t specify a primary attribute.


tonyarnold commented Apr 12, 2014

Given that we now support importing records without a primary attribute specified, this assertion is going to fire in that circumstance. I don't think we need it anymore, but feel free to correct me — it's late, and I may have missed something.

@tonyarnold tonyarnold closed this Apr 12, 2014

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