Skip to content

Commit

Permalink
Fixed copying primary key
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewcheok committed Mar 21, 2015
1 parent 31b387e commit 3df38d3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Realm+JSON/RLMObject+Copying.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
#import <Realm/RLMProperty.h>
#import <Realm/RLMObjectSchema.h>

@interface RLMProperty (Copying_Internal)

@property (nonatomic, assign) BOOL isPrimary;

@end

@implementation RLMObject (Copying)

- (instancetype)shallowCopy {
Expand All @@ -31,7 +37,7 @@ - (void)mergePropertiesFromObject:(id)object {
[thisArray addObjects:thatArray];
}
// assume data
else {
else if (!property.isPrimary) {
id value = [object valueForKeyPath:property.name];
[self setValue:value forKeyPath:property.name];
}
Expand Down

0 comments on commit 3df38d3

Please sign in to comment.