Permalink
Browse files

Moved Update into a UpdateAt function similar to CreatedAt

  • Loading branch information...
1 parent 97a2e6a commit 7870f5adf8df01c13f553bf9f25d4f04a0a67d54 James Burka committed Oct 27, 2008
Showing with 10 additions and 4 deletions.
  1. +2 −0 .gitignore
  2. +7 −3 Classes/lib/ActiveResource+Base.m
  3. +1 −1 Classes/lib/ObjectiveResourceDateFormatter.m
View
@@ -15,5 +15,7 @@ sample_rails_app/log/*.log
sample_rails_app/tmp/**/*
sample_rails_app/doc/api
sample_rails_app/doc/app
+sample_rails_app/db/*.sqlite3
+
@@ -128,6 +128,12 @@ - (BOOL)createAtPath:(NSString *)path {
}
}
+-(BOOL)updateAtPath:(NSString *)path {
+ return [[Connection put:[self toXMLElementExcluding:[NSArray arrayWithObject:[self classIdName]]]
+ to:path
+ withUser:[[self class] getUser] andPassword:[[self class] getPassword]] isSuccess];
+}
+
- (BOOL)destroyAtPath:(NSString *) path {
return [[Connection delete:path withUser:[[self class] getUser] andPassword:[[self class] getPassword]] isSuccess];
}
@@ -153,9 +159,7 @@ - (BOOL)destroy {
- (BOOL)update {
id myId = [self getId];
if (nil != myId) {
- return [[Connection put:[self toXMLElementExcluding:[NSArray arrayWithObject:[self classIdName]]]
- to:[[self class] elementPath:myId]
- withUser:[[self class] getUser] andPassword:[[self class] getPassword]] isSuccess];
+ return [self updateAtPath:[[self class] elementPath:myId]];
}
else {
return NO;
@@ -11,7 +11,7 @@
@implementation ObjectiveResourceDateFormatter
-static NSString * dateFormatString = @"yyyy-MM-dd'T'HH:mm:ss'Z'";
+static NSString *dateFormatString = @"yyyy-MM-dd'T'HH:mm:ss'Z'";
+ (void)setFormatString:(NSString *)format {
dateFormatString = format;

0 comments on commit 7870f5a

Please sign in to comment.