diff options
author | Yehuda Katz <wycats@gmail.com> | 2009-01-30 10:53:14 -0800 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-01-30 10:53:19 -0800 |
commit | da10673e32718d6a0619bd0f4b4d3d796db86a1a (patch) | |
tree | 7bdb7868b0be65daec06ba729f68deccfe61a8bb /activerecord/lib/active_record/validations.rb | |
parent | b8fadd708b9850a77e1f64038763fffcff502499 (diff) | |
parent | ed0e5640879fd42c00fc5900e0355a0ea1dcf2ad (diff) | |
download | rails-da10673e32718d6a0619bd0f4b4d3d796db86a1a.tar.gz rails-da10673e32718d6a0619bd0f4b4d3d796db86a1a.tar.bz2 rails-da10673e32718d6a0619bd0f4b4d3d796db86a1a.zip |
Sync 'rails/rails/master'
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 |