Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
ce8f6c7
Fault updated objects before merging changes into mainQueueManagedObj…
ppierson Feb 6, 2015
8d08948
Add identificationPredicateBlock to filter matches based on the JSON …
May 1, 2015
36be35d
Don't expect to receive the same object in the receiver
razmara May 3, 2015
4c0e70a
updated podspec
razmara May 3, 2015
8a1b812
Fix concurrency issues triggered by setting debug flag -com.apple.Cor…
May 15, 2015
4d3c8e1
Fix alignment in method call.
May 15, 2015
45aee26
Merge pull request #2217 from cfis/concurrency
segiddins May 15, 2015
0170270
[Bundle] Update CocoaPods
segiddins May 19, 2015
562a8d8
Updated broken URLs for those which have a working alternative
Jun 10, 2015
219ced5
Define contexts for CocoaLumberjack
0xced Jun 10, 2015
8fe3c12
Fix for issue #2232. RKAttributeMapping not copying valueTransformer …
vilinskiy-playdayteam Jun 11, 2015
2566a9b
Fix for compilation on iOS < 7.0. See https://github.com/RestKit/Rest…
Jun 17, 2015
26ff9ab
Test case for NSFetchedResultsController observing Managed Object upd…
ppierson Apr 20, 2015
24a8be0
Merge pull request #2233 from vilinskiy-playdayteam/development
segiddins Jun 26, 2015
382c3cf
Merge pull request #2230 from mozeryansky/development
segiddins Jun 26, 2015
d6dc8ff
Merge pull request #2212 from percysnoodle/id-by-block
segiddins Jun 26, 2015
809fc53
Merge pull request #2238 from emlynmac/development
segiddins Jun 26, 2015
36955d4
Added macro conditionals to remove build warnings built against post-…
samkrishna Jul 21, 2015
c9c078e
Merge pull request #2248 from samkrishna/development
segiddins Jul 21, 2015
0b8baca
Bump ruby version to 2.2.2
segiddins Jul 22, 2015
de2d31d
[Bundle] Update
segiddins Jul 22, 2015
560e96e
[Bundle] Update CocoaPods to 0.38
segiddins Jul 22, 2015
9998d2b
Merge pull request #2158 from ppierson/fault_updates_merging_contexts
segiddins Aug 2, 2015
87434b1
Merge pull request #2231 from 0xced/CocoaLumberjack-contexts
segiddins Aug 2, 2015
fcff50c
Add support for inclusion of RestKit as a Clang Module
segiddins Jan 25, 2015
67b89b8
[TestEnvironment] Import instead of include
segiddins Jan 25, 2015
4282232
[LumberjackLogger] Use new macro definition of component definitions
segiddins Jan 25, 2015
3064187
Always build using CocoaPods
segiddins Jun 14, 2015
7bf03d4
Make the framework imports sane
segiddins Jun 14, 2015
4224856
Also lint on CI as a static lib
segiddins Jun 14, 2015
ec1d470
Remove vestigial submodules
segiddins Jun 14, 2015
22dc46d
Update example projects to use CocoaPods
adolfo Jul 27, 2015
948ae92
Update CI test with updated build scheme name
adolfo Jul 27, 2015
323bf88
Save RKTwitter build scheme for CI
adolfo Jul 27, 2015
c567522
Merge pull request #2145 from RestKit/seg-clang-modules
segiddins Aug 2, 2015
3c43765
[Podspec] Bumpe ISO8601 dependency
segiddins Aug 7, 2015
fecde9d
Release v0.25.0
segiddins Aug 7, 2015
0e7bf23
Merge branch 'release/0.25.0'
segiddins Aug 7, 2015
8fd5424
Assign used properties of NSDateComponents object to zero before use.…
Aug 13, 2015
e1cbf49
Test failing with RestKit v0.25.0, if this define is true at compile …
Aug 14, 2015
2afb3c7
Indent with spaces.
Aug 16, 2015
a74fea1
Merge pull request #2267 from rojo69/development
segiddins Aug 21, 2015
8637490
Log core data save errors on the context's queue to avoid multithread…
Adlai-Holler Aug 25, 2015
098a8fa
Fix indentation
Adlai-Holler Aug 25, 2015
bb5889d
Update project settings to use spaces not tabs
Adlai-Holler Aug 25, 2015
edc0d66
Discard irrelevant change
Adlai-Holler Aug 25, 2015
8c93e30
Document how to enable RestKit in a Swift project
Adlai-Holler Aug 25, 2015
c00a49a
Use the right context
Adlai-Holler Aug 25, 2015
cd5c77a
Log core data save errors in the queue for the context where the erro…
Adlai-Holler Aug 25, 2015
8a60a2c
Merge pull request #2278 from Tripstr/indentation-settings
segiddins Aug 25, 2015
00bfae2
Update documentation to mention @import RestKit option
Adlai-Holler Aug 25, 2015
c6b5d15
Remove AFNetworking logs
0xced Aug 21, 2015
a86b6c4
Refactor RKHTTPRequestOperation logs
0xced Aug 21, 2015
84ad5b9
Improve RKHTTPRequestOperation logs
0xced Aug 21, 2015
dd1b183
Fix documentation for RKEntityMapping.modificationAttribute
Adlai-Holler Aug 25, 2015
a927a79
Merge pull request #2281 from Tripstr/fix-modificationattribute-doc
segiddins Aug 26, 2015
9b2f514
Merge pull request #2273 from 0xced/better-network-logs
segiddins Aug 26, 2015
4aea56a
Update TransitionKit dependency to version 2.2
0xced Aug 26, 2015
411549e
Merge pull request #2282 from 0xced/TransitionKit-dependency
segiddins Aug 26, 2015
705990b
Mapping: Ignore NSNull in source collections
Adlai-Holler Aug 26, 2015
fd4159c
indentation
Adlai-Holler Aug 26, 2015
e7ad501
Test that mapper ignores NSNull in collections
Adlai-Holler Aug 26, 2015
199d5b4
Merge pull request #2284 from REXLabsInc/ignore-nulls-in-collections
segiddins Aug 26, 2015
4e4dc71
Add RKEntityMapping.shouldMapRelationshipsIfObjectIsUnmodified flag
Adlai-Holler Aug 26, 2015
b71abc5
Add back mappingOperationShouldSkipPropertyMapping: for backwards com…
Adlai-Holler Aug 26, 2015
a44b246
Test that shouldMapRelationshipsIfObjectIsUnmodified flag works
Adlai-Holler Aug 27, 2015
72ac303
Update other managed object data source tests for relationship skipping
Adlai-Holler Aug 27, 2015
d08cd4d
Remove implementation of deprecated method
Adlai-Holler Aug 27, 2015
8b0d916
Indentation
Adlai-Holler Aug 27, 2015
61ea93b
Merge pull request #2277 from Tripstr/fix-core-data-error-log-multith…
segiddins Aug 27, 2015
821ca92
Merge pull request #2279 from Tripstr/document-swift-importing
segiddins Aug 27, 2015
f3d6d6b
Document mapping operation data source shouldSkip methods
Adlai-Holler Aug 27, 2015
51d3c49
Merge pull request #2286 from REXLabsInc/map-relationships-unmodified…
Aug 27, 2015
a874245
RKObjectMapping.inverseMappings should be `RKObjectMapping *` not `in…
Adlai-Holler Aug 29, 2015
856d54b
Merge pull request #2289 from RestKit/inverse-mapping-return-type
Aug 29, 2015
5c055fe
Use frameworks when integrating the OS X example
segiddins Aug 30, 2015
8cbb122
Use NS_ENUM for RKMappingErrorCode
Adlai-Holler Aug 31, 2015
6551f1b
Merge pull request #2290 from RestKit/swift-enum-compatibility
Aug 31, 2015
9cb579c
Add debug logs for inferred identification attributes
0xced Sep 20, 2015
b2f5c2d
Handle comma-separated string for `RKEntityIdentificationAttributes`
0xced Sep 20, 2015
ea1a8e8
Use a for/in loop instead of `enumerateObjectsUsingBlock:`
0xced Sep 20, 2015
971b5a8
Fix potential crash when mapping an invalid keyPath
0xced Aug 28, 2015
ec77960
Merge pull request #2305 from 0xced/identification-attributes
segiddins Sep 20, 2015
fc101de
[Travis] Limit the branches we build
segiddins Sep 24, 2015
4f23e6d
Fix nested refetched objects
mberube09 Sep 30, 2015
af03d63
override superclass designated initializer and throw exception if des…
cryptojuice Oct 1, 2015
4facc30
additional initializer overrides
cryptojuice Oct 1, 2015
6078915
removed typed array
cryptojuice Oct 1, 2015
75fca81
Internally assign initWithType:subpredicates as designated initialize…
cryptojuice Oct 1, 2015
2242448
Reverted back to calling designated initializer initWithManagedObject…
cryptojuice Oct 5, 2015
98d48b2
Merge pull request #2320 from mberube09/mberube09-fix-nested-refetch
segiddins Oct 6, 2015
7c8efb4
Merge pull request #2321 from cryptojuice/override-designated-initial…
segiddins Oct 7, 2015
12d99d8
[Gemfile] Update CocoaPods to 0.39
segiddins Oct 10, 2015
7a5b7e8
Merge pull request #2325 from RestKit/seg-update-cocoapods
segiddins Oct 10, 2015
49dae11
Support "Age" HTTP response header.
Oct 26, 2015
7512827
Don't return deleted NSManagedObject objects from the in memory cache
AgentFeeble Oct 28, 2015
0c10e98
Merge pull request #2339 from AgentFeeble/in-memory-cache-fix
segiddins Oct 28, 2015
4d8ff80
Add CocoaLumberjack subspec
timbodeit Aug 11, 2015
9bee0e6
Check RKLOG_USE_COCOALUMBERJACK macro before using CocoaLumberjack
timbodeit Aug 11, 2015
90e0113
Move RKLumberjackLogger to different folder
timbodeit Aug 11, 2015
4d43dc9
Fix RestKit project
timbodeit Aug 21, 2015
52551e2
Switch to CocoaLumberjack 2.0 API [#2263]
timbodeit Aug 21, 2015
0d41f8b
Replace RKLOG_USE_COCOALUMBERJACK macro
timbodeit Nov 3, 2015
40e16d6
Merge pull request #2264 from timbodeit/2262-CocoaLumberjack-Subspec
segiddins Nov 3, 2015
2e01400
Use framework-style import statements
segiddins Sep 24, 2015
28e3ce8
Sort all imports
segiddins Sep 24, 2015
4c71591
[Gemfile] Point to CocoaPods branch
segiddins Oct 24, 2015
3521dec
[Rakefile] Autostart server for ci task
segiddins Oct 24, 2015
cf7c34b
Ensure all headers are inside the header mapping dir
segiddins Oct 24, 2015
da7d8b7
[Gemfile] Point to CocoaPods master
segiddins Nov 1, 2015
35446c7
Fix import path for lumberjack
segiddins Nov 12, 2015
1ba6e0e
[Rakefile] Allow warnings when linting pod
segiddins Nov 12, 2015
f28e429
Add CocoaLumberjack to podfile
segiddins Nov 12, 2015
1599c5e
Merge pull request #2306 from 0xced/testShouldFailWithoutThrowingIfMa…
segiddins Nov 12, 2015
1f17acd
Merge pull request #2310 from RestKit/seg-bracket-imports
segiddins Nov 12, 2015
6b80a88
Merge pull request #2337 from rojo69/development
segiddins Nov 13, 2015
d93587b
[Rakefile] Add a release task
segiddins Nov 13, 2015
fc396b2
[Rakefile] gsub the podspec version instead of reading from file
segiddins Nov 13, 2015
3a80796
Merge pull request #2351 from RestKit/seg-release-task
segiddins Nov 13, 2015
c65fbf2
[Rakefile] Run pod install during release task
segiddins Nov 13, 2015
29a8502
[Rakefile] Push to CocoaPods during release
segiddins Nov 13, 2015
e473ec8
Release v0.26.0
segiddins Nov 13, 2015
6735369
Merge tag 'v0.26.0'
segiddins Nov 13, 2015
cf319cf
Merge remote-tracking branch 'upstream/master'
razmara Feb 3, 2016
ccf135f
Merge branch 'development'
Feb 13, 2016
29b5699
Update version for Restkit podspec
Feb 13, 2016
b47fa20
conflict resolved
razmara Feb 16, 2016
c93c557
Add back csrf check
Feb 16, 2016
49fb8f2
Merge branch 'master' of github.com:razmara/RestKit
razmara Sep 25, 2018
c33d7fb
Update RKManagedObjectStore.m
YevgenStarikov Oct 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ DerivedData
# Bundler binstubs
.bundle
bin
RestKit.xcscmblueprint
15 changes: 0 additions & 15 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,15 +0,0 @@
[submodule "Vendor/AFNetworking"]
path = Vendor/AFNetworking
url = https://github.com/AFNetworking/AFNetworking.git
[submodule "Vendor/TransitionKit"]
path = Vendor/TransitionKit
url = https://github.com/blakewatters/TransitionKit.git
[submodule "Vendor/RKValueTransformers"]
path = Vendor/RKValueTransformers
url = https://github.com/RestKit/RKValueTransformers.git
[submodule "Vendor/ISO8601DateFormatterValueTransformer"]
path = Vendor/ISO8601DateFormatterValueTransformer
url = https://github.com/blakewatters/ISO8601DateFormatterValueTransformer.git
[submodule "Vendor/SOCKit"]
path = Vendor/SOCKit
url = https://github.com/NimbusKit/sockit.git
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.1
2.2.2
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
language: objective-c
rvm: 2.2.1
rvm: 2.2.2
install:
- bundle install
- bundle exec pod install
script:
- bundle exec rake ci
branches:
only:
- master
- development
- /^release/
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Issues

GitHub Issues is for reporting bugs in RestKit and discussing changes to RestKit itself. Please check the [documentation](http://cocoadocs.org/docsets/RestKit/), [wiki](https://github.com/RestKit/RestKit/wiki), and [existing issues](https://github.com/RestKit/RestKit/issues?state=closed) before opening a new issue.
GitHub Issues is for reporting bugs in RestKit and discussing changes to RestKit itself. Please check the [documentation](http://cocoadocs.org/docsets/RestKit/), [wiki](https://github.com/RestKit/RestKit/wiki), and [existing issues](https://github.com/RestKit/RestKit/issues?q=is:issue) before opening a new issue.

Additionaly, please do not post general usage questions to Issues, but instead take them to [Stack Overflow](http://stackoverflow.com/questions/tagged/restkit).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#import <Foundation/Foundation.h>

#if __has_include("DDLog.h")
#import "RKLog.h"
#if __has_include(<CocoaLumberjack/CocoaLumberjack.h>)
#import <RestKit/Support/RKLog.h>

@interface RKLumberjackLogger : NSObject <RKLogging>
@end
Expand Down
110 changes: 110 additions & 0 deletions Code/CocoaLumberjack/RKLumberjackLogger.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
//
// RKLumberjackLogger.m
// Pods
//
// Created by C_Lindberg,Carl on 10/31/14.
//
//

#if __has_include(<CocoaLumberjack/CocoaLumberjack.h>)
#import <CocoaLumberjack/CocoaLumberjack.h>
#import <RestKit/CocoaLumberjack/RKLumberjackLogger.h>

@implementation RKLumberjackLogger

+ (DDLogLevel)ddLogLevelFromRKLogLevel:(_RKlcl_level_t)rkLevel
{
switch (rkLevel)
{
case RKLogLevelOff: return DDLogLevelOff;
case RKLogLevelCritical: return DDLogLevelError;
case RKLogLevelError: return DDLogLevelError;
case RKLogLevelWarning: return DDLogLevelWarning;
case RKLogLevelInfo: return DDLogLevelInfo;
case RKLogLevelDebug: return DDLogLevelDebug;
case RKLogLevelTrace: return DDLogLevelVerbose;
}

return DDLogLevelDebug;
}

+ (DDLogFlag)ddLogFlagFromRKLogLevel:(_RKlcl_level_t)rkLevel
{
switch (rkLevel)
{
case RKLogLevelOff: return 0;
case RKLogLevelCritical: return DDLogFlagError;
case RKLogLevelError: return DDLogFlagError;
case RKLogLevelWarning: return DDLogFlagWarning;
case RKLogLevelInfo: return DDLogFlagInfo;
case RKLogLevelDebug: return DDLogFlagDebug;
case RKLogLevelTrace: return DDLogFlagVerbose;
}

return DDLogFlagDebug;
}

+ (_RKlcl_level_t)rkLogLevelFromDDLogLevel:(DDLogLevel)ddLogLevel
{
if (ddLogLevel & DDLogFlagVerbose) return RKLogLevelTrace;
if (ddLogLevel & DDLogFlagDebug) return RKLogLevelDebug;
if (ddLogLevel & DDLogFlagInfo) return RKLogLevelInfo;
if (ddLogLevel & DDLogFlagWarning) return RKLogLevelWarning;
if (ddLogLevel & DDLogFlagError) return RKLogLevelError;

return RKLogLevelOff;
}


#pragma mark RKLogging

+ (void)logWithComponent:(_RKlcl_component_t)component
level:(_RKlcl_level_t)level
path:(const char *)path
line:(uint32_t)line
function:(const char *)function
format:(NSString *)format, ...
{
va_list args;
va_start(args, format);

DDLogFlag flag = [self ddLogFlagFromRKLogLevel:level];
DDLogLevel componentLevel = [self ddLogLevelFromRKLogLevel:_RKlcl_component_level[component]];
BOOL async = LOG_ASYNC_ENABLED && ((flag & DDLogFlagError) == 0);

[DDLog log:async
level:componentLevel
flag:flag
context:0x524B5F00 + component
file:path function:function line:line
tag:nil
format:format args:args];
va_end(args);
}

@end

/* Create a DDRegisteredDynamicLogging class for each RestKit component */

#import <RestKit/Support/lcl_config_components_RK.h>

#undef _RKlcl_component
#define _RKlcl_component(_identifier, _header, _name) \
@interface RKLumberjackLog##_identifier : NSObject <DDRegisteredDynamicLogging> \
@end \
@implementation RKLumberjackLog##_identifier \
+ (DDLogLevel)ddLogLevel { \
_RKlcl_level_t level = _RKlcl_component_level[RKlcl_c##_identifier]; \
return [RKLumberjackLogger ddLogLevelFromRKLogLevel:level]; \
} \
+ (void)ddSetLogLevel:(DDLogLevel)logLevel { \
RKLogConfigureByName(_name, [RKLumberjackLogger rkLogLevelFromDDLogLevel:logLevel]); \
} \
@end

RKLCLComponentDefinitions

#undef _RKlcl_component


#endif
22 changes: 11 additions & 11 deletions Code/CoreData.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
//

#import <CoreData/CoreData.h>
#import "ObjectMapping.h"
#import "RKManagedObjectStore.h"
#import "RKManagedObjectImporter.h"
#import "RKManagedObjectMappingOperationDataSource.h"
#import "RKEntityMapping.h"
#import "RKManagedObjectCaching.h"
#import "RKInMemoryManagedObjectCache.h"
#import "RKFetchRequestManagedObjectCache.h"
#import <RestKit/CoreData/RKEntityMapping.h>
#import <RestKit/CoreData/RKFetchRequestManagedObjectCache.h>
#import <RestKit/CoreData/RKInMemoryManagedObjectCache.h>
#import <RestKit/CoreData/RKManagedObjectCaching.h>
#import <RestKit/CoreData/RKManagedObjectImporter.h>
#import <RestKit/CoreData/RKManagedObjectMappingOperationDataSource.h>
#import <RestKit/CoreData/RKManagedObjectStore.h>
#import <RestKit/ObjectMapping.h>

#import "RKPropertyInspector+CoreData.h"
#import "NSManagedObjectContext+RKAdditions.h"
#import "NSManagedObject+RKAdditions.h"
#import <RestKit/CoreData/NSManagedObject+RKAdditions.h>
#import <RestKit/CoreData/NSManagedObjectContext+RKAdditions.h>
#import <RestKit/CoreData/RKPropertyInspector+CoreData.h>
8 changes: 4 additions & 4 deletions Code/CoreData/NSManagedObject+RKAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
// Copyright (c) 2009-2012 RestKit. All rights reserved.
//

#import "NSManagedObject+RKAdditions.h"
#import "NSManagedObjectContext+RKAdditions.h"
#import "RKLog.h"
#import "RKManagedObjectStore.h"
#import <RestKit/CoreData/NSManagedObject+RKAdditions.h>
#import <RestKit/CoreData/NSManagedObjectContext+RKAdditions.h>
#import <RestKit/CoreData/RKManagedObjectStore.h>
#import <RestKit/Support/RKLog.h>

@implementation NSManagedObject (RKAdditions)

Expand Down
4 changes: 2 additions & 2 deletions Code/CoreData/NSManagedObjectContext+RKAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
// limitations under the License.
//

#import <RestKit/CoreData/NSManagedObjectContext+RKAdditions.h>
#import <RestKit/Support/RKLog.h>
#import <objc/runtime.h>
#import "NSManagedObjectContext+RKAdditions.h"
#import "RKLog.h"

@implementation NSManagedObjectContext (RKAdditions)

Expand Down
2 changes: 1 addition & 1 deletion Code/CoreData/RKConnectionDescription.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// limitations under the License.
//

#import "RKConnectionDescription.h"
#import <RestKit/CoreData/RKConnectionDescription.h>

static NSSet *RKSetWithInvalidAttributesForEntity(NSArray *attributes, NSEntityDescription *entity)
{
Expand Down
2 changes: 1 addition & 1 deletion Code/CoreData/RKCoreData.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
#ifndef RestKit_RKCoreData_h
#define RestKit_RKCoreData_h

#import "CoreData.h"
#import <RestKit/CoreData.h>

#endif
19 changes: 10 additions & 9 deletions Code/CoreData/RKEntityByAttributeCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
#import <UIKit/UIKit.h>
#endif

#import "RKEntityByAttributeCache.h"
#import "RKLog.h"
#import "RKPropertyInspector.h"
#import "RKPropertyInspector+CoreData.h"
#import "NSManagedObject+RKAdditions.h"
#import "RKObjectUtilities.h"
#import <RestKit/CoreData/NSManagedObject+RKAdditions.h>
#import <RestKit/CoreData/RKEntityByAttributeCache.h>
#import <RestKit/CoreData/RKPropertyInspector+CoreData.h>
#import <RestKit/ObjectMapping/RKObjectUtilities.h>
#import <RestKit/ObjectMapping/RKPropertyInspector.h>
#import <RestKit/Support/RKLog.h>

// Set Logging Component
#undef RKLogComponent
Expand Down Expand Up @@ -211,16 +211,17 @@ - (NSManagedObject *)objectForObjectID:(NSManagedObjectID *)objectID inContext:(
{
/**
NOTE:

We use `existingObjectWithID:` as opposed to `objectWithID:` as `objectWithID:` can return us a fault
that will raise an exception when fired. `existingObjectWithID:error:` will return nil if the ID has been
deleted. `objectRegisteredForID:` is also an acceptable approach.
that will raise an exception when fired. `objectRegisteredForID:` is also an acceptable approach.
*/
__block NSError *error = nil;
__block NSManagedObject *object;
[context performBlockAndWait:^{
object = [context existingObjectWithID:objectID error:&error];
}];
// Don't return the object if it has been deleted.
if ([object isDeleted]) object = nil;
if (! object) {
// Referential integrity errors often indicates that the temporary objectID does not exist in the specified context
if (error && !([objectID isTemporaryID] && [error code] == NSManagedObjectReferentialIntegrityError)) {
Expand Down
4 changes: 2 additions & 2 deletions Code/CoreData/RKEntityCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
// limitations under the License.
//

#import "RKEntityCache.h"
#import "RKEntityByAttributeCache.h"
#import <RestKit/CoreData/RKEntityByAttributeCache.h>
#import <RestKit/CoreData/RKEntityCache.h>

@interface RKEntityCache ()
@property (nonatomic, strong) NSMutableSet *attributeCaches;
Expand Down
24 changes: 20 additions & 4 deletions Code/CoreData/RKEntityMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
//

#import <CoreData/CoreData.h>
#import "RKObjectMapping.h"
#import "RKConnectionDescription.h"
#import "RKMacros.h"
#import <RestKit/CoreData/RKConnectionDescription.h>
#import <RestKit/ObjectMapping/RKObjectMapping.h>
#import <RestKit/Support/RKMacros.h>

@class RKManagedObjectStore;

Expand Down Expand Up @@ -114,17 +114,33 @@
*/
@property (nonatomic, copy) NSPredicate *identificationPredicate;

/**
An optional block which returns a predicate used to filter identified objects during mapping.

@return The identification predicate block.
*/
@property (nonatomic, copy) NSPredicate *(^identificationPredicateBlock)(NSDictionary *representation, NSManagedObjectContext *managedObjectContext);

/**
An optional attribute of the receiver's entity that can be used to detect modification of a given instance. This is used to improve the performance of mapping operations by skipping the property mappings for a given object if it is found to be not modified.

A common modification attribute is a 'last modified' or 'updated at' timestamp that specifies the timestamp of the last change to an object. When the `modificationAttribute` is non-nil, the mapper will compare the value returned of the attribute on an existing object instance with the value in the representation being mapped.

The semantics of the comparison are dependent on the data type of the modification attribute. If the attribute is a string, then the values are compared for equality. If the attribute is a date or a numeric value, then the values will be compared numerically and mapping will be skipped if the value in the representation is greater than the value of the modification attribute stored on the object.
The semantics of the comparison are dependent on the data type of the modification attribute. If the attribute is a string, then the values are compared for equality. If the attribute is a date or a numeric value, then the values will be compared numerically and mapping will be skipped unless the value in the representation is greater than the value of the modification attribute stored on the object.

@raises NSInvalidArgumentException Raised if the attribute given is not a property of the receiver's entity.
*/
@property (nonatomic, strong) NSAttributeDescription *modificationAttribute;

/**
If this is YES, mapping operations will map relationships of the object even if the `modificationAttribute` shows that the object has not been modified.

This is useful if a response contains a nested object that has been updated inside an object that has not.

Defaults to NO.
*/
@property (nonatomic) BOOL shouldMapRelationshipsIfObjectIsUnmodified;

/**
Sets the `modificationAttribute` to the receiver to the attribute with the specified name.

Expand Down
Loading