-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rails validation error parsing and unit tests
This initial commit has full support for JSON with unit tests that demonstrate the functionality. When switching into XML mode some unit tests fail so the XML support for this new functionality still needs attention. Signed-off-by: Joshua Vickery <josh@yfactorial.com>
- Loading branch information
Showing
10 changed files
with
92 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// NSError+Error.h | ||
// objective_resource | ||
// | ||
// Created by Adam Alexander on 3/10/09. | ||
// Copyright 2009 yFactorial, LLC. All rights reserved. | ||
// | ||
|
||
@interface NSError(Error) | ||
|
||
-(NSArray *)errors; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// NSError+Error.m | ||
// objective_resource | ||
// | ||
// Created by Adam Alexander on 3/10/09. | ||
// Copyright 2009 yFactorial, LLC. All rights reserved. | ||
// | ||
|
||
#import "NSError+Error.h" | ||
|
||
@implementation NSError(Error) | ||
|
||
-(NSArray *)errors { | ||
return [self.userInfo valueForKey:NSLocalizedRecoveryOptionsErrorKey]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
class Dog < ActiveRecord::Base | ||
belongs_to :person | ||
validates_exclusion_of :name, :in => ["ReservedName"] | ||
end |