The RKRailsRouter no longer sends params with delete requests.

The RKObjectLoader will now clean up deleted objects inside of processLoadModelsInBackground:
This commit is contained in:
Jeremy Ellison
2011-01-06 15:47:09 -05:00
parent b31e6426a5
commit f690fa19f3
2 changed files with 11 additions and 2 deletions

View File

@@ -169,8 +169,12 @@
if (self.targetObject) {
if (_targetObjectID) {
NSManagedObject* backgroundThreadModel = [self.managedObjectStore objectWithID:_targetObjectID];
[_mapper mapObject:backgroundThreadModel fromString:[response bodyAsString]];
results = [NSArray arrayWithObject:backgroundThreadModel];
if (self.method == RKRequestMethodDELETE) {
[[objectStore managedObjectContext] deleteObject:backgroundThreadModel];
} else {
[_mapper mapObject:backgroundThreadModel fromString:[response bodyAsString]];
results = [NSArray arrayWithObject:backgroundThreadModel];
}
} else {
[_mapper mapObject:self.targetObject fromString:[response bodyAsString]];
results = [NSArray arrayWithObject:self.targetObject];