Skip to content

Commit

Permalink
Merge branch 'release/0.10.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
blakewatters committed Apr 5, 2012
2 parents 8d0d9fc + 587fc73 commit 69adee9
Show file tree
Hide file tree
Showing 620 changed files with 31,475 additions and 7,866 deletions.
7 changes: 4 additions & 3 deletions .gitignore
Expand Up @@ -7,6 +7,7 @@ Docs/API
# temp nibs and swap files
*~.nib
*.swp
*.orig

# OS X folder attributes
.DS_Store
Expand All @@ -20,6 +21,6 @@ Docs/API

Examples/RKDiscussionBoardExample/discussion_board_backend/public/system/attachments/*

# UISpecRunner cached build path
.uispec.app
Specs/Runner/UISpec
# Thin
log
tmp
2 changes: 1 addition & 1 deletion .gitmodules
@@ -1,3 +1,3 @@
[submodule "Examples/RKCatalog/Server"]
path = Examples/RKCatalog/Server
url = git://github.com/twotoasters/RKCatalog-Server.git
url = git://github.com/RestKit/RKCatalog-Server.git
105 changes: 76 additions & 29 deletions CREDITS.md
Expand Up @@ -6,32 +6,79 @@ as a Ruby on Rails specific object mapper for XML data. In early 2010 the framew
rebranded as RestKit and evolved into a general purpose HTTP toolkit and object mapping
system.

RestKit is a production of Two Toasters and available as an Open Source package under
the terms of the Apache License (see LICENSE for details).

Original Author
---------------
* Blake Watters (blakewatters) @blakewatters

Core Team
---------
* Jeremy Ellison (jeremyellison)
* Daniel Hammond (danielrhammond)
* Jeff Arena (jeffarena)

Web Designer
------------
* Adit Shukla (aditshukla)

Contributors
------------
* Marc Weil (aspir)
* Pat Shields (pashields)
* Tim Kerchmar (timkerchmar)
* Rachit Shukla (rachitshukla)
* Adam Hinz (ahinz)
* Stefan Eletzhofer (seletz)
* Peter Marks (tassock)
* Chad Podoski (chadpod)
* Andras Hatvani (andrashatvani)
* Ed McManus (emcmanus)
RestKit is available as an Open Source package under the terms of the Apache License (see
LICENSE for details).

## Original Author
* Blake Watters (blakewatters) @blakewatters

## Core Team
* Jeff Arena (jeffarena)
* Gregory Combs (grgcombs)
* Brian Morton (bmorton)

## Web Designer
* Adit Shukla (aditshukla)

## Contributors
#### Version 0.9.3 and earlier
* Jeremy Ellison (jeremyellison)
* Daniel Hammond (danielrhammond)
* Marc Weil (aspir)
* Pat Shields (pashields)
* Tim Kerchmar (timkerchmar)
* Rachit Shukla (rachitshukla)
* Adam Hinz (ahinz)
* Stefan Eletzhofer (seletz)
* Peter Marks (tassock)
* Chad Podoski (chadpod)
* Andras Hatvani (andrashatvani)
* Ed McManus (emcmanus)

#### Version 0.10.0
* Christopher Swasey (endash)
* Aneil Mallavarapu (amallavarapu)
* Rui D Lopes (ruidlopes)
* Robert Altman (inquinity)
* Beat Besmer (besi)
* Scott Penrose (spenrose)
* Charlie Savage (cfis)
* Jawwad Ahmad (jawwad)
* John Stallings (jstallings)
* Bob Spryn (sprynmr)
* Ray Fix (rayfix)
* Marlon Andrade (marlonandrade)
* David Young-Chan Kay (DavidYKay)
* Chethan Reddy (creddy)
* Julien Grimault (juliengrimault)
* Matthias Bartelmeß
* Nolan Waite (nolanw)
* Michael Fleet (fantasticmf)
* Tony Lee (hktonylee)
* Aaron Crespo (aaroncrespo)
* James Sullivan (jsullivanlive)
* Marco Pesenti Gritti (marcopg)
* Brad Phelan (bradphelan)
* Ivan Vučica (ivucica)
* Felix Holmgren (Felixyz)
* Open Thread (OpenFibers)
* Sergej Tatarincev (SevInf)
* Ben Einstein (beinstein)
* Johan Bilien (jobi)
* Björn Jonsson (bjornjonsson)
* Ralf van der Zanden (ralfvdz)
* Parker Boundy (parkerboundy)
* Jeremy Mack (mutewinter)
* Allen Wei (allenwei)
* Robin Eggenkamp (Edubits)
* Emil Wojtaszek (emilwojtaszek)
* Victor Kryukov (victorkryukov)
* Cody Rayment (crayment)
* Arne Harren (aharren)
* Cameron Royal (cammm)

## Honorable Mentions
RestKit would like to thank the following companies for aiding in the support of this product:

* GateGuru - http://www.gateguru.com
* Two Toasters - http://www.twotoasters.com
14 changes: 12 additions & 2 deletions Code/CoreData/CoreData.h
Expand Up @@ -3,7 +3,7 @@
// RestKit
//
// Created by Blake Watters on 9/30/10.
// Copyright 2010 Two Toasters
// Copyright (c) 2009-2012 RestKit. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -23,6 +23,16 @@
#import "NSManagedObject+ActiveRecord.h"
#import "RKManagedObjectStore.h"
#import "RKManagedObjectSeeder.h"
#import "RKManagedObjectCache.h"
#import "RKManagedObjectMapping.h"
#import "RKManagedObjectMappingOperation.h"
#import "RKManagedObjectMappingCache.h"
#import "RKInMemoryManagedObjectCache.h"
#import "RKFetchRequestManagedObjectCache.h"
#import "RKSearchableManagedObject.h"
#import "RKSearchWord.h"

#import "RKObjectPropertyInspector+CoreData.h"
#import "RKObjectMappingProvider+CoreData.h"
#import "NSManagedObjectContext+RKAdditions.h"
#import "NSManagedObject+RKAdditions.h"
#import "NSEntityDescription+RKAdditions.h"
39 changes: 39 additions & 0 deletions Code/CoreData/NSEntityDescription+RKAdditions.h
@@ -0,0 +1,39 @@
//
// NSEntityDescription+RKAdditions.h
// RestKit
//
// Created by Blake Watters on 3/22/12.
// Copyright (c) 2009-2012 RestKit. All rights reserved.
//

#import <CoreData/CoreData.h>

/**
The key for retrieving the name of the attribute that acts as
the primary key from the user info dictionary of the receiving NSEntityDescription.
**Value**: @"primaryKeyAttribute"
*/
extern NSString * const RKEntityDescriptionPrimaryKeyAttributeUserInfoKey;

/**
Provides extensions to NSEntityDescription for various common tasks.
*/
@interface NSEntityDescription (RKAdditions)

/**
The name of the attribute that acts as the primary key for the receiver.
The primary key attribute can be configured in two ways:
1. From within the Xcode Core Data editing view by
adding the desired attribute's name as the value for the
key `primaryKeyAttribute` to the user info dictionary.
1. Programmatically, by retrieving the NSEntityDescription instance and
setting the property's value.
Programmatically configured values take precedence over the user info
dictionary.
*/
@property(nonatomic, retain) NSString *primaryKeyAttribute;

@end
38 changes: 38 additions & 0 deletions Code/CoreData/NSEntityDescription+RKAdditions.m
@@ -0,0 +1,38 @@
//
// NSEntityDescription+RKAdditions.m
// RestKit
//
// Created by Blake Watters on 3/22/12.
// Copyright (c) 2009-2012 RestKit. All rights reserved.
//

#import <objc/runtime.h>
#import "NSEntityDescription+RKAdditions.h"

NSString * const RKEntityDescriptionPrimaryKeyAttributeUserInfoKey = @"primaryKeyAttribute";
static char primaryKeyAttributeKey;

@implementation NSEntityDescription (RKAdditions)

- (NSString *)primaryKeyAttribute
{
// Check for an associative object reference
NSString *primaryKeyAttribute = (NSString *) objc_getAssociatedObject(self, &primaryKeyAttributeKey);

// Fall back to the userInfo dictionary
if (! primaryKeyAttribute) {
primaryKeyAttribute = [self.userInfo valueForKey:RKEntityDescriptionPrimaryKeyAttributeUserInfoKey];
}

return primaryKeyAttribute;
}

- (void)setPrimaryKeyAttribute:(NSString *)primaryKeyAttribute
{
objc_setAssociatedObject(self,
&primaryKeyAttributeKey,
primaryKeyAttribute,
OBJC_ASSOCIATION_RETAIN);
}

@end
46 changes: 40 additions & 6 deletions Code/CoreData/NSManagedObject+ActiveRecord.h
@@ -1,5 +1,5 @@
//
// RKManagedObject+ActiveRecord.h
// NSManagedObject+ActiveRecord.h
//
// Adapted from https://github.com/magicalpanda/MagicalRecord
// Created by Saul Mora on 11/15/09.
Expand All @@ -10,16 +10,25 @@

#import <CoreData/CoreData.h>

@interface NSManagedObject (ActiveRecord)
/**
Extensions to NSManagedObjectContext for RestKit's Active Record pattern implementation
*/
@interface NSManagedObjectContext (ActiveRecord)

+ (NSManagedObjectContext *)defaultContext;
+ (void)setDefaultContext:(NSManagedObjectContext *)context;
+ (NSManagedObjectContext *)contextForCurrentThread;

@end

/**
* The Core Data managed object context from the RKObjectManager's objectStore
* that is managing this model
Provides extensions to NSManagedObject implementing a low-ceremony querying
interface.
*/
+ (NSManagedObjectContext*)managedObjectContext;
@interface NSManagedObject (ActiveRecord)

/**
* The NSEntityDescription for the Subclass
* The NSEntityDescription for the Subclass
* defaults to the subclass className, may be overridden
*/
+ (NSEntityDescription*)entity;
Expand All @@ -34,6 +43,12 @@
*/
+ (NSArray*)objectsWithFetchRequest:(NSFetchRequest*)fetchRequest;

/**
* Retrieves the number of objects that would be retrieved by the fetchRequest,
* if executed
*/
+ (NSUInteger)countOfObjectsWithFetchRequest:(NSFetchRequest*)fetchRequest;

/**
* Fetches all objects from the persistent store via a set of fetch requests and
* returns all results in a single array.
Expand Down Expand Up @@ -88,6 +103,25 @@
*/
- (BOOL)isNew;

/**
Finds the instance of the receiver's entity with the given value for the primary key attribute
in the managed object context for the current thread.
@param primaryKeyValue The value for the receiving entity's primary key attribute.
@return The object with the primary key attribute equal to the given value or nil.
*/
+ (id)findByPrimaryKey:(id)primaryKeyValue;

/**
Finds the instance of the receiver's entity with the given value for the primary key attribute in
the given managed object context.
@param primaryKeyValue The value for the receiving entity's primary key attribute.
@param context The managed object context to find the instance in.
@return The object with the primary key attribute equal to the given value or nil.
*/
+ (id)findByPrimaryKey:(id)primaryKeyValue inContext:(NSManagedObjectContext *)context;

////////////////////////////////////////////////////////////////////////////////////////////////////

+ (NSManagedObjectContext*)currentContext;
Expand Down

0 comments on commit 69adee9

Please sign in to comment.