Skip to content

Commit

Permalink
Merge pull request #18 from hyperoslo/fix/parent-relationship
Browse files Browse the repository at this point in the history
Set parent relationship only if they have the same type
  • Loading branch information
NSElvis committed Mar 3, 2015
2 parents 6d5e758 + 8146a80 commit 71b7715
Show file tree
Hide file tree
Showing 10 changed files with 2,016 additions and 1,904 deletions.
2 changes: 1 addition & 1 deletion Source/Sync.m
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ - (void)sync_processRelationshipsUsingDictionary:(NSDictionary *)objectDict
if (relationship.isToMany) {
[self sync_processToManyRelationship:relationship usingDictionary:objectDict andParent:parent dataStack:dataStack];
} else {
if (parent) {
if (parent && [relationship.destinationEntity.name isEqualToString:parent.entity.name]) {
[self setValue:parent forKey:relationship.name];
} else {
[self sync_processToOneRelationship:relationship usingDictionary:objectDict];
Expand Down
4 changes: 2 additions & 2 deletions Tests/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PODS:
- NSManagedObject-ANDYMapChanges (0.6):
- NSManagedObject-ANDYObjectIDs
- NSManagedObject-ANDYObjectIDs (0.2)
- NSManagedObject-HYPPropertyMapper (2.8.1):
- NSManagedObject-HYPPropertyMapper (2.9):
- NSString-HYPNetworking
- NSString-HYPNetworking (0.1)

Expand All @@ -22,7 +22,7 @@ SPEC CHECKSUMS:
NSJSONSerialization-ANDYJSONFile: 238ae79c050f8ed5a735448db8b0e1c9e9b0f587
NSManagedObject-ANDYMapChanges: f5d20e903eafecb844adfa1a7e355a1f8cf083a8
NSManagedObject-ANDYObjectIDs: 7148a374e2d163392b0442dce51e7cc2bf94b356
NSManagedObject-HYPPropertyMapper: 13abcf971f00cf098ed5e148b1aa7fa2801f9e6a
NSManagedObject-HYPPropertyMapper: b59f7b4906250e9f24fa53899123c1b8d7f2f711
NSString-HYPNetworking: 941953383edbba2abd72014e4bfdd55fa4af8dff

COCOAPODS: 0.35.0
4 changes: 2 additions & 2 deletions Tests/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 71b7715

Please sign in to comment.