Skip to content

Commit

Permalink
Only check for MTLModel protocol conformance
Browse files Browse the repository at this point in the history
  • Loading branch information
priteshshah1983 committed Oct 28, 2015
1 parent 66af2bf commit 857c826
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Mantle/MTLJSONAdapter.m
Expand Up @@ -508,7 +508,7 @@ @implementation MTLJSONAdapter (ValueTransformers)
reverseBlock:^ NSDictionary * (id model, BOOL *success, NSError **error) {
if (model == nil) return nil;

if (![model isKindOfClass:MTLModel.class] || ![model conformsToProtocol:@protocol(MTLJSONSerializing)]) {
if (![model conformsToProtocol:@protocol(MTLModel)] || ![model conformsToProtocol:@protocol(MTLJSONSerializing)]) {
if (error != NULL) {
NSDictionary *userInfo = @{
NSLocalizedDescriptionKey: NSLocalizedString(@"Could not convert model object to JSON dictionary", @""),
Expand Down
2 changes: 1 addition & 1 deletion Mantle/NSDictionary+MTLMappingAdditions.m
Expand Up @@ -13,7 +13,7 @@
@implementation NSDictionary (MTLMappingAdditions)

+ (NSDictionary *)mtl_identityPropertyMapWithModel:(Class)modelClass {
NSCParameterAssert([modelClass isSubclassOfClass:MTLModel.class]);
NSCParameterAssert([modelClass conformsToProtocol:@protocol(MTLModel)]);

NSArray *propertyKeys = [modelClass propertyKeys].allObjects;

Expand Down

0 comments on commit 857c826

Please sign in to comment.