diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-02-08 17:11:27 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-02-08 17:11:27 -0800 |
commit | f99b254e4e382ddd2cc86acff9ed80663b8c7817 (patch) | |
tree | 8b195b8e9577e3ee10990c57b254b0a5fb11e787 /activerecord/lib/active_record | |
parent | 3b684dde779af4cb06950bfe788d8fb0852ab936 (diff) | |
parent | 5e3d466d52fa4e9a42c3a1f8773a7c31da875e48 (diff) | |
download | rails-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.rb | 2 |
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}" |