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

assignsDefaultValueForMissingAttributes overwritten in inverse mappings #2063

Open
pablobfs opened this issue Oct 27, 2014 · 0 comments
Open

Comments

@pablobfs
Copy link

Hi there, I think I found an issue in latest release, 0.23.3.

I create an object mapping and set assignsDefaultValueForMissingAttributes to NO, then I create the inverse mapping and the assignsDefaultValueForMissingAttributes value is overwritten to YES.

RKEntityMapping *mapping = [RKEntityMapping mappingForEntityForName:[self entityName] inManagedObjectStore:[RKManagedObjectStore defaultStore]];
mapping.assignsDefaultValueForMissingAttributes = NO;
// map attributes and relationships...

RKObjectMapping *inverse = mapping inverseMapping];
// inverse.assignsDefaultValueForMissingAttributes == YES

I tracked the issue down to the - (RKObjectMapping *)invertMapping:(RKObjectMapping *)mapping withPredicate:(BOOL (^)(RKPropertyMapping *propertyMapping))predicatemethod in the RKObjectMapping class , it contains the following lines:

// We want to serialize `nil` values
inverseMapping.assignsDefaultValueForMissingAttributes = YES;
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

No branches or pull requests

1 participant