1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

14 commits

Author SHA1 Message Date
Santiago Pastorino
b451de0d6d Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;) 2010-08-14 04:12:33 -03:00
Neeraj Singh
1ce40ca562 ensuring that description does not exceed 100 columns 2010-08-02 12:25:26 -04:00
Jeroen van Dijk
26392c4ac5 Make ActiveModel::Errors#add_on_blank and #add_on_empty accept an options hash and make various Validators pass their (filtered) options.
This makes it possible to pass additional options through Validators to message generation. E.g. plugin authors want to add validates_presence_of :foo, :format => "some format".

Also, cleanup the :default vs :message options confusion in ActiveModel validation message generation.

Also, deprecate ActiveModel::Errors#add_on_blank(attributes, custom_message) in favor of ActiveModel::Errors#add_on_blank(attributes, options).

Also, refactoring of ActiveModel and ActiveRecord Validation tests. Test are a lot more DRY now. Better test coverage as well now.

The first four points were reapplied from an older patch of Sven Fuchs which didn't apply cleanly anymore and was not complete yet.

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-21 11:55:21 +02:00
Jeremy Kemper
86dda361e2 Avoid deprecated String#to_a by using Array.wrap(...) instead of Array(...) 2010-04-10 22:37:36 -07:00
Aaron Patterson
98d2d8ce2c use the database to lower case strings rather than ruby. [#4293 state:resolved]
Signed-off-by: wycats <wycats@gmail.com>
2010-03-28 22:16:34 -07:00
Pratik Naik
cd90dcb1bd Rename Model.active_relation to Model.unscoped 2010-01-17 03:00:56 +05:30
José Valim
93898b389b Ensure new validates works with uniqueness validator. 2010-01-08 23:50:31 +01:00
Pratik Naik
4a7a14b0e1 Use relations to build uniqueness conditions 2010-01-02 03:46:08 +05:30
Jeremy Kemper
1b91f534ce Fix uniqueness validation: with_exclusive_scope is not public 2009-12-28 14:06:22 -08:00
José Valim
74098e4cb6 No need to use ValidationsRepairHelper hack on ActiveModel anymore, Model.reset_callbacks(:validate) is enough. However, tests in ActiveRecord are still coupled, so moved ValidationsRepairHelper back there. 2009-12-23 13:30:58 +01:00
José Valim
44cd9e0e71 ActiveRecord::Validations are now built on top of Validator as well. 2009-12-23 12:14:00 +01:00
Elise Huard
c5896bfd84 validate uniqueness with limit in utf8
[#2653 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 12:50:04 -07:00
Pratik Naik
22ad30ed60 Move validate_on_create and validate_on_update from ActiveModel to ActiveRecord 2009-03-21 01:11:38 +00:00
Pratik Naik
638333b7a1 Move uniqueness and association validations to Active Record 2009-03-19 23:44:30 +00:00