From c1bab7abd666d809aa01c330a66c53e1b6abe6c4 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Mon, 9 Jul 2012 09:27:48 +0000 Subject: Improve QueryKit's handling of quotes by making it on by default. Also, add a bunch more tests. --- Frameworks/QueryKit/Source/QKQueryUpdateParameter.m | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'Frameworks/QueryKit/Source/QKQueryUpdateParameter.m') diff --git a/Frameworks/QueryKit/Source/QKQueryUpdateParameter.m b/Frameworks/QueryKit/Source/QKQueryUpdateParameter.m index febbfa44..8df3aba5 100644 --- a/Frameworks/QueryKit/Source/QKQueryUpdateParameter.m +++ b/Frameworks/QueryKit/Source/QKQueryUpdateParameter.m @@ -29,12 +29,10 @@ // OTHER DEALINGS IN THE SOFTWARE. #import "QKQueryUpdateParameter.h" +#import "QKQueryConstants.h" @implementation QKQueryUpdateParameter -@synthesize _field; -@synthesize _value; - #pragma mark - #pragma mark Initialisation @@ -61,21 +59,11 @@ NSString *field = [_field stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; - [string appendString:field]; + [string appendFormat:@"%@%@%@", [self useQuotes] ? QUERY_QUOTE : EMPTY_STRING, field, [self useQuotes] ? QUERY_QUOTE : EMPTY_STRING]; [string appendString:@" = "]; [string appendFormat:(![_value isKindOfClass:[NSNumber class]]) ? @"'%@'" : @"%@", [_value description]]; return string; } -#pragma mark - - -- (void)dealloc -{ - if (_field) [_field release], _field = nil; - if (_value) [_value release], _value = nil; - - [super dealloc]; -} - @end -- cgit v1.2.3