Permalink
Browse files

Slight change to "inDatabase" property

  • Loading branch information...
p2 committed Mar 17, 2012
1 parent 16afbd2 commit 13cc6a2c303425b1cb1b2f58d90b642719465070
Showing with 3 additions and 3 deletions.
  1. +2 −2 Classes/SQLiteObject.h
  2. +1 −1 Classes/SQLiteObject.m
View
@@ -21,9 +21,9 @@
@interface SQLiteObject : NSObject
@property (nonatomic, unsafe_unretained) FMDatabase *db;
-@property (nonatomic, strong) id object_id; ///< The object id can either be an NSNumber or NSString (e.g. for UUIDs)
+@property (nonatomic, strong) id object_id; ///< The object id can either be an NSNumber or NSString (e.g. for UUIDs)
@property (nonatomic, readonly, assign, getter=isHydrated) BOOL hydrated;
-@property (nonatomic, readonly, assign, getter=isInDatabase) BOOL inDatabase; ///< Set to YES if the object has been hydrated from db or dehydrated at least once
+@property (nonatomic, readonly, assign, getter=isInDatabase) BOOL inDatabase; ///< Set to YES if one of the "[de]hydrate" methods has been called on the object
+ (id)newWithDatabase:(FMDatabase *)aDatabase;
View
@@ -59,6 +59,7 @@ - (void)setFromDictionary:(NSDictionary *)dict
*/
- (void)hydrateFromDictionary:(NSDictionary *)dict
{
+ inDatabase = YES;
[self autofillFrom:dict overwrite:YES];
}
@@ -188,7 +189,6 @@ - (BOOL)hydrate
[self hydrateFromDictionary:[res resultDict]];
[res close];
hydrated = YES;
- inDatabase = YES;
[self didHydrateSuccessfully:hydrated];
return hydrated;

0 comments on commit 13cc6a2

Please sign in to comment.