aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-02-08 17:11:27 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2014-02-08 17:11:27 -0800
commitf99b254e4e382ddd2cc86acff9ed80663b8c7817 (patch)
tree8b195b8e9577e3ee10990c57b254b0a5fb11e787 /activerecord/lib/active_record
parent3b684dde779af4cb06950bfe788d8fb0852ab936 (diff)
parent5e3d466d52fa4e9a42c3a1f8773a7c31da875e48 (diff)
downloadrails-f99b254e4e382ddd2cc86acff9ed80663b8c7817.tar.gz
rails-f99b254e4e382ddd2cc86acff9ed80663b8c7817.tar.bz2
rails-f99b254e4e382ddd2cc86acff9ed80663b8c7817.zip
Merge pull request #13978 from Fortisque/kevin/validation_context_for_children
context in validation goes through has many relationship
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/autosave_association.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/autosave_association.rb b/activerecord/lib/active_record/autosave_association.rb
index e9622ca0c1..4f58d06f35 100644
--- a/activerecord/lib/active_record/autosave_association.rb
+++ b/activerecord/lib/active_record/autosave_association.rb
@@ -301,7 +301,7 @@ module ActiveRecord
def association_valid?(reflection, record)
return true if record.destroyed? || record.marked_for_destruction?
- unless valid = record.valid?
+ unless valid = record.valid?(self.validation_context)
if reflection.options[:autosave]
record.errors.each do |attribute, message|
attribute = "#{reflection.name}.#{attribute}"