aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/validations
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@plataformatec.com.br>2013-06-04 00:33:50 +0900
committerJosé Valim <jose.valim@plataformatec.com.br>2013-06-04 00:33:50 +0900
commit75135a97907b4bdeb51eefaaaf8bd35215206fa7 (patch)
treee55ef4e0e7a1585553ff3f247edd8728bf3db6a9 /activerecord/lib/active_record/validations
parent2767f833841ea18aaa50d2bff3465310d3e0afac (diff)
downloadrails-75135a97907b4bdeb51eefaaaf8bd35215206fa7.tar.gz
rails-75135a97907b4bdeb51eefaaaf8bd35215206fa7.tar.bz2
rails-75135a97907b4bdeb51eefaaaf8bd35215206fa7.zip
Revert "Merge pull request #4490 from EmmanuelOga/master"
This behaviour doesn't actually make sense, the context of the child should not be affected by the parent. See #10492. This reverts commit 5f8274efe128ffeec8fa3179460f5167a078f007, reversing changes made to 81e837e810460d066a2e5fc5a795366ec8ab2313.
Diffstat (limited to 'activerecord/lib/active_record/validations')
-rw-r--r--activerecord/lib/active_record/validations/associated.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/validations/associated.rb b/activerecord/lib/active_record/validations/associated.rb
index 744780d069..b4785d3ba4 100644
--- a/activerecord/lib/active_record/validations/associated.rb
+++ b/activerecord/lib/active_record/validations/associated.rb
@@ -2,7 +2,7 @@ module ActiveRecord
module Validations
class AssociatedValidator < ActiveModel::EachValidator #:nodoc:
def validate_each(record, attribute, value)
- if Array.wrap(value).reject {|r| r.marked_for_destruction? || r.valid?(record.validation_context) }.any?
+ if Array.wrap(value).reject {|r| r.marked_for_destruction? || r.valid?}.any?
record.errors.add(attribute, :invalid, options.merge(:value => value))
end
end