Commit Graph

30 Commits

Author SHA1 Message Date
Adam Meehan
d61dddfbc6 fix i18n locale load order to allow customisation
fix interpolation values for i18n
2009-06-19 12:06:36 +10:00
Adam Meehan
3348ca3063 dont rely on add_error return value to exit. sigh, less one liners 2009-04-12 10:23:09 +10:00
Adam Meehan
88ee33ae41 consistently use instance methods vs vars in validator 2009-04-12 10:17:33 +10:00
Adam Meehan
bb94e234bc add :format option to validate and parse with specific a format 2009-04-10 10:57:27 +10:00
Adam Meehan
d89266d9f1 minor stuff 2009-03-31 21:25:05 +11:00
Adam Meehan
f4ed751c26 changed back to using error_value_formats for Rails 2.0/2.1 2009-03-28 19:51:11 +11:00
Adam Meehan
7967b5a212 refactored error value formats to use locale file for I18n. Rail 2.0/2.1 to use default_error_value_formats now.
moved default_error_messages_method into validator
2009-03-28 18:49:26 +11:00
Adam Meehan
a836ed8434 changed Formats#parse to take options hash for strict and other possibilities 2009-03-28 17:35:41 +11:00
Adam Meehan
312c1510cb refactored AR parsing methods into Parser module to reduce AR method pollution and make more consistent 2009-03-28 17:25:48 +11:00
Adam Meehan
d1ee94248b added :equal_to and :ignore_usec options. the later is for ignore microsecond value in datetime restrictions 2009-03-19 20:49:06 +11:00
Adam Meehan
fae38cfecd use value as raw_value if object doesn't have _before_type_cast method 2009-03-12 19:08:31 +11:00
Adam Meehan
903850bc23 Merge branch 'with' for with_date and with_time options 2009-03-10 15:51:07 +11:00
Adam Meehan
403a91addf added if and unless to valid options 2009-03-04 21:09:51 +11:00
Adam Meehan
862b41f903 added :with_date and :with_time options
refactored restriction_value into evaluate_option_value class method for more general usage
refactored type_cast_value into class method
2009-02-09 16:44:03 +11:00
Adam Meehan
904c202fb4 little cleanup and consistency 2009-02-09 12:11:56 +11:00
Adam Meehan
7ef9078369 use the value from validates_each in validator 2009-02-08 12:46:22 +11:00
Adam Meehan
a1ae5f9313 added option key validation to prevent silly validation problems due to bad key name 2009-02-01 20:08:07 +11:00
Adam Meehan
525b3b9941 fix custom_error_message hash bug using wrong match data index 2009-01-12 12:35:35 +11:00
Adam Meehan
45ab815039 added between option and some refactoring 2009-01-01 20:11:30 +11:00
Adam Meehan
5abaec66ae remove version check, check for I what I want 2008-12-09 16:56:03 +11:00
Adam Meehan
e4760126e2 allow for a string column being validated as a date/time 2008-12-07 11:06:43 +11:00
Adam Meehan
4cb51ae602 teeny comment correction 2008-12-05 20:30:54 +11:00
Adam Meehan
87b0beef5a moved ignore_restriction_errors and error_value_formats into Validator class 2008-12-05 20:24:06 +11:00
Adam Meehan
6cd6cd9dc0 made restriction_value instance method as it relies on validator instance attribute type
removed old type_cast_method class method
2008-12-05 18:45:28 +11:00
Adam Meehan
0c5cc1a536 more refactoring of validator
fixed bug when Date is restriction value for a datetime attribute so its cast to time in default timezone
2008-12-05 18:25:44 +11:00
Adam Meehan
71f2a43424 added i18n support for error messages in Rails 2.2 2008-12-03 18:20:34 +11:00
Adam Meehan
3ac65b507f renamed methods which have been moved out of AR and so dont need to be fully qualified 2008-12-02 20:34:02 +11:00
Adam Meehan
d71f581e10 refactored error message handling and specs 2008-12-02 19:36:03 +11:00
Adam Meehan
aa42fb76b6 get the model to add errors to record returned from validation instead of validator 2008-11-30 08:34:17 +11:00
Adam Meehan
b0647d456e refactored validations in validation methods for model and validator class 2008-11-30 07:40:11 +11:00