diff options
author | Ahmed El-Daly <aeldaly@developergurus.com> | 2009-01-29 23:04:49 -0500 |
---|---|---|
committer | Ahmed El-Daly <aeldaly@developergurus.com> | 2009-01-29 23:04:49 -0500 |
commit | 43d63298f7693a437b454b4b8ee84946af350572 (patch) | |
tree | 55166f7c3118061a1fd0df2cb3cf6ea6e31647b9 /activerecord/lib/active_record/validations.rb | |
parent | 6623e4f92a69c2aa0a12957db430b00690d50d19 (diff) | |
parent | 24b688d31d34dc7582c8e2ac4347d0c36e3c5e10 (diff) | |
download | rails-43d63298f7693a437b454b4b8ee84946af350572.tar.gz rails-43d63298f7693a437b454b4b8ee84946af350572.tar.bz2 rails-43d63298f7693a437b454b4b8ee84946af350572.zip |
Merge branch 'master' of git@github.com:lifo/docrails
Diffstat (limited to 'activerecord/lib/active_record/validations.rb')
-rw-r--r-- | activerecord/lib/active_record/validations.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb index 6a9690ba85..6d750accb0 100644 --- a/activerecord/lib/active_record/validations.rb +++ b/activerecord/lib/active_record/validations.rb @@ -904,7 +904,7 @@ module ActiveRecord configuration.update(attr_names.extract_options!) validates_each(attr_names, configuration) do |record, attr_name, value| - unless (value.is_a?(Array) ? value : [value]).inject(true) { |v, r| (r.nil? || r.valid?) && v } + unless (value.is_a?(Array) ? value : [value]).collect { |r| r.nil? || r.valid? }.all? record.errors.add(attr_name, :invalid, :default => configuration[:message], :value => value) end end |