Commit Graph

165 Commits

Author SHA1 Message Date
Adam Meehan
1001d29c01 rails 2.3.0 fix with I18n.reload!
added 2.3 to ginger list
2009-02-08 20:54:45 +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
71583805c8 fixed regex for yy format token which wasn't greedy enough when datetime string parsed as date causing a 4 digit year to be extracted as first 2 digits 2009-01-21 14:07:35 +11:00
Adam Meehan
0ad8ace335 refactored AR attribute methods to define read method for all date, time and datetime attributes. Makes things much clearer and fixes bug reported (#2) by Brad (pvjg) 2009-01-13 10:12:41 +11:00
Adam Meehan
760a52a2a4 cleanup matcher spec a little 2009-01-12 13:08:22 +11:00
Adam Meehan
011ea070db fix interpolation_values examples for rails version without i18n 2009-01-12 13:03:21 +11:00
Adam Meehan
b632093ce2 add examples for custom_error_messages and interpolation values. what can I say? TATFT 2009-01-12 12:36:37 +11:00
Adam Meehan
a71d6f7945 added between option testing to matcher and refactored 2009-01-01 20:13:44 +11:00
Adam Meehan
45ab815039 added between option and some refactoring 2009-01-01 20:11:30 +11:00
Adam Meehan
c308aaf4a9 refactored attribute name handling in spec 2008-12-28 17:22:24 +11:00
Adam Meehan
e9fa4ca20a fixed bug where accessor methods not properly generating due columns_hash lookup failing on method name as a symbol
force value to time on write unless is a date attribute
2008-12-07 11:07:39 +11:00
Adam Meehan
e82b1e2033 removed some time_travel setup which are not used here 2008-12-06 14:42:21 +11:00
Adam Meehan
64ffb52dae spec text tweaks 2008-12-06 14:27:20 +11:00
Adam Meehan
a691b4ed35 moved sqlite patch into seperate file 2008-12-06 09:06:24 +11:00
Adam Meehan
e2790538a8 added make_time examples 2008-12-05 20:46:40 +11:00
Adam Meehan
75f3ef34e8 made parameters explicit for validates_timeliness since its private and should not be used directly for validation 2008-12-05 20:35:37 +11:00
Adam Meehan
dad55456d5 patched sqlite adapter in spec_helper to fix time attributes in rails 2.0.2 errorneously reporting time attributes as datetime column types 2008-12-05 20:25:28 +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
c224db7af8 moved specs to validator 2008-12-05 18:24:31 +11:00
Adam Meehan
4868746e94 refactor specs from validation_methods to validator and refactored to make much more sense 2008-12-05 18:23:39 +11:00
Adam Meehan
bf999170d7 fix timezone issue for to_dummy_time as per normal Rails which uses AR default_timezone 2008-12-05 16:34:28 +11:00
Adam Meehan
1596ffd2cb namespaced matcher 2008-12-02 21:07:08 +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
Adam Meehan
9610d79d7d move core extension spec to namespace folder 2008-11-29 18:55:18 +11:00
Adam Meehan
412ff22dd9 namespaced ActiveRecord and ActionView specifc modules and specs with a mind to making the plugin framework agnostic in the future 2008-11-29 18:32:32 +11:00
Adam Meehan
21d26ee2b1 remove multiparameter time format example for 2.0.x because sqlite didn't support time column types in that version 2008-11-29 10:52:03 +11:00
Adam Meehan
5a4be4a91e added ginger scenarios to run specs against all supported rails versions 2008-11-24 05:25:05 +11:00
Adam Meehan
a425555de6 remove explicit interop require which is done in rspec-rails 2008-11-22 10:38:36 +11:00
Adam Meehan
34c3f8602b removing some spec cruft as now using rpec-rails gem 2008-11-22 10:33:49 +11:00
Adam Meehan
abbf79faae removed unnecessary version condition 2008-11-22 09:46:28 +11:00
Adam Meehan
889bdc3ae3 allow uppercase meridian to be valid 2008-11-13 10:26:16 +11:00
Adam Meehan
604a792e25 Rails 2.2 compatibility fixes with more version check hackery (yuck, will fix later) 2008-10-28 22:05:25 +11:00
Adam Meehan
2f162ca500 little spec house cleaning 2008-10-28 20:03:37 +11:00
Adam Meehan
ced61929da fixed dirty attributes when old value incorrectly read and added more examples for dirty attributes 2008-10-28 19:54:52 +11:00
Adam Meehan
f23d2a0c2d fixed non-timezone write method not updating changed attributes hash 2008-08-25 14:30:36 +10:00
Adam Meehan
0ef34c7d28 parse_date_time method returns for date column to return Date object when assigned string as per normal Rails
parse_date_time method returns same object when assigned Date or Time object
2008-08-22 15:12:38 +10:00
Adam Meehan
aecaa7baca silence migration in specs 2008-08-22 14:21:05 +10:00
Adam Meehan
b9f11a1f7b fixed bug with attribute cache not clearing on write for date and time columns 2008-08-22 14:06:08 +10:00
Adam Meehan
d61249d6f5 fixed instance_tag value method when attribute value is nil and improved specs 2008-08-14 11:44:18 +10:00
Adam Meehan
a666c35ccd moved restriction value evaluation into own method with recursive calls for Symbol and Proc in case they return string 2008-08-03 12:53:59 +10:00
Adam Meehan
8cad1b880e remove setting attribute to nil in validations when invalid to preserve before_type_cast value 2008-07-30 12:22:06 +10:00
Adam Meehan
7fd251dddf added rest of specs for matcher 2008-07-26 07:49:26 +10:00
Adam Meehan
9e689746f3 improved some example descriptions 2008-07-26 00:16:51 +10:00
Adam Meehan
79460dc39b added specs for matcher and fixed up bugs 2008-07-26 00:16:17 +10:00
Adam Meehan
56a95ebd62 add paths to front of loadpath 2008-07-25 21:51:44 +10:00
Adam Meehan
608f3b569f more date value standardisation 2008-07-25 19:19:47 +10:00
Adam Meehan
24db8ab774 changed to using accessor for model instance and using specific validation method for each type 2008-07-25 19:17:55 +10:00
Adam Meehan
59caa86618 changed spec to be like rails behaviour 2008-07-23 20:40:34 +10:00
Adam Meehan
55333d6ca3 standardising test date values 2008-07-23 20:38:18 +10:00
Adam Meehan
5c03d3d645 added define_write_method with simple parse and cace for dates, times and datetimes when time zone conversion is off and default for Rails 2.0 2008-07-23 12:42:03 +10:00
Adam Meehan
7500781887 added compile_set method to get expressions and combine date and datetime expressions to allow a date string to parse when type is datetime
made internal methods private
2008-07-23 12:39:20 +10:00
Adam Meehan
85ac2bfc69 changed method to check type and compose string for specific type to properly validate
refactored specs
2008-07-23 12:35:42 +10:00
Adam Meehan
28b44b4ca6 some docs tweaks and spec value changes 2008-07-22 11:47:17 +10:00
Adam Meehan
8082b5ce1c added specs for checking call to parse method to verify read and write attribute methods are defined 2008-07-22 11:39:17 +10:00
Adam Meehan
175b5c8d36 moved type cast conversion specs from attribute_methods to validations 2008-07-22 10:12:53 +10:00
Adam Meehan
89f12b3a25 renamed extract method to parse and updated specs 2008-07-22 08:34:14 +10:00
Adam Meehan
e8bba051c9 fixed spec with microseconds 2008-07-22 08:29:11 +10:00
Adam Meehan
5e08a10fb0 renamed calls to timeliness_date_time_parse to parse_date_time which will correctly an overrided method 2008-07-21 13:48:25 +10:00
Adam Meehan
4e8007bc65 added ignore_datetime_restriction_errors class option and docs
bit more for chronic parser
2008-07-21 13:02:21 +10:00
Adam Meehan
1836e4f6ca removed setting of time parts to 0 for date type in parse as any time parts should be valid as well
format proc now returns time array with nil values as 0
2008-07-21 10:31:06 +10:00
Adam Meehan
7a16d35e31 tweaked readme
changed mixed validation spec to datetime value out of Time range
2008-07-20 10:53:09 +10:00
Adam Meehan
9cf994564e fixed fallback for out of range dates which Rails does not handle automatically
aliased timeliness_date_time_parse to parse_date_time for nicer interface
2008-07-20 09:06:39 +10:00
Adam Meehan
70ba75a4ae added switching to euro date formats instead of US 2008-07-20 08:38:34 +10:00
Adam Meehan
5f55fad076 added :before option to add_formats to insert above existing format 2008-07-20 07:45:22 +10:00
Adam Meehan
5983622ac8 moved extact_date_time_values method in to Formats and added specs
changed Formats to a class
2008-07-19 19:47:03 +10:00
Adam Meehan
1d2720ca67 added less than exhaustive datetime format validation specs 2008-07-19 17:25:01 +10:00
Adam Meehan
8ab82411ca added format add and remove methods
fixed slashes and 'd' token matching
specs for time and date format validation
2008-07-19 17:17:53 +10:00
Adam Meehan
ec46a3bd35 added specs for formats and more docs
renamed valid_time_formats etc to time_formats
2008-07-18 16:29:26 +10:00
Adam Meehan
33c298163e moved format proc helper methods into formats module so they work 2008-07-17 16:25:54 +10:00
Adam Meehan
0dcc255901 changed parsing to use hash of regexp with optional processor blocks. Allows easy addition and removal of preffered formats 2008-07-17 14:29:59 +10:00
Adam Meehan
1a0a35836f fixed dummy time and added spec 2008-07-11 17:41:07 +10:00
Adam Meehan
20ed2b1633 ignore time part for dates in validation 2008-07-11 17:23:37 +10:00
Adam Meehan
c283d2eed9 rename base to multiparameter attributes 2008-07-11 16:31:19 +10:00
Adam Meehan
7f1ada4d0e refactored specs into type validations, added some more examples for boundary checks 2008-07-08 10:44:43 +10:00
Adam Meehan
8c5b372716 added birth_time attribute 2008-07-08 10:38:14 +10:00
Adam Meehan
d6cf8f0889 fixed require for rspec-rails 2008-07-07 15:24:37 +10:00
Adam Meehan
a5daef2069 added library require file for rspec-rails 2008-07-07 15:17:11 +10:00
Adam Meehan
771f42f076 added rspec-rails for view method specs 2008-07-07 15:16:30 +10:00
Adam Meehan
494f3bdef4 added time_travel plugin for validation specs to fix time from Time.now 2008-07-07 15:12:28 +10:00
Adam Meehan
bb42ef215f added full spec 2008-07-07 15:10:08 +10:00
Adam Meehan
5edfa5f2fc renamed module DateHelper to InstanceTag 2008-07-07 09:50:29 +10:00
Adam Meehan
6ffb7e5780 doc tweaks and minor stuff 2008-07-01 11:34:49 +10:00
Adam Meehan
d035de1d7c refactored restrictions validation into own method
added validates_*type methods for forcing the value type used when doing restriction validation
2008-07-01 11:31:17 +10:00
Adam Meehan
64a402676e added version display for AR 2008-06-30 22:38:30 +10:00
Adam Meehan
8b69ec8134 changed schema to be version agnostic 2008-06-30 22:37:51 +10:00
Adam Meehan
a69e018992 added dirty attribute handling 2008-06-30 22:37:13 +10:00
Adam Meehan
39e16d2fde fixed error on database write with saving cached values for time attributes which have been converted 2008-06-30 16:30:13 +10:00
Adam Meehan
ed23c4a9a4 refactored to convert and cache user input value on write to distinguish from values in read raw from database which allows correct timezone conversion
added override for read_attribute to check for failed time type cast which should save nil value
2008-06-30 15:38:33 +10:00
Adam Meehan
ec12d60224 changed spec_helper rails version selection to use VERSION
added RAILS_VER constant for version checking
fixed rspec module include requirement for 1.1.4 in specs
2008-06-27 09:56:45 +10:00
Adam Meehan
685b0054fe set time zone aware attributes on in spec helper for AR 2008-05-22 07:35:01 +10:00
Adam Meehan
fb463ca7a0 fixed time object passed to strict_time_type_cast error 2008-05-21 17:03:19 +10:00
Adam Meehan
a9b033e539 added strict_time_type_cast method to handle casting
refactored to be simler and rely on read_atribute method conversion
rather than use new reader method definer got time (Rails 2.1)
2008-05-21 16:55:10 +10:00
Adam Meehan
7fadc2c164 tightened up specs for attribute methods 2008-05-21 10:02:13 +10:00
Adam Meehan
c6312329ec changed rails version detection to be tighter to avoid rails RC problem
added rspec on rails validate_timeliness_of matcher
2008-05-15 11:00:07 +10:00
Adam Meehan
10856b32d0 added vendored_rails check for time zone setting 2008-05-14 11:22:44 +10:00