Skip to content
This repository
Browse code

Adding keyPathsForValuesAffectingValueForKey for scalar *Value proper…

…ties.
  • Loading branch information...
commit fdc4a02c2180493d24a68fddc98ddd35b1fc1277 1 parent 12298a8
Tony Arnold authored November 11, 2010

Showing 1 changed file with 11 additions and 0 deletions. Show diff stats Hide diff stats

  1. 11  templates/machine.m.motemplate
11  templates/machine.m.motemplate
@@ -26,6 +26,17 @@
26 26
 	return (<$managedObjectClassName$>ID*)[super objectID];
27 27
 }
28 28
 
  29
++ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
  30
+	NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];
  31
+	<$foreach Attribute noninheritedAttributes do$><$if Attribute.hasDefinedAttributeType$><$if Attribute.hasScalarAttributeType$>
  32
+	if ([key isEqualToString:@"<$Attribute.name$>Value"]) {
  33
+		NSSet *affectingKey = [NSSet setWithObject:@"<$Attribute.name$>"];
  34
+		keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
  35
+	}<$endif$><$endif$><$endforeach do$>
  36
+
  37
+	return keyPaths;
  38
+}
  39
+
29 40
 <$foreach Attribute noninheritedAttributes do$>
30 41
 <$if Attribute.hasDefinedAttributeType$>
31 42
 

0 notes on commit fdc4a02

Please sign in to comment.
Something went wrong with that request. Please try again.