diff options
author | Eileen M. Uchitelle <eileencodes@users.noreply.github.com> | 2019-07-24 14:44:53 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-24 14:44:53 -0400 |
commit | 0206d9cb7c823fefbf3dfc1d1672be4628986c4e (patch) | |
tree | 070bdb208f7ddcba7a3ed9006c7ab65d22221390 /activerecord/lib/active_record/autosave_association.rb | |
parent | 0744e15a35446865c6eced891a1356ccff4513d9 (diff) | |
parent | 6ea80b6103de9ef76dca9d51149dd94bec846642 (diff) | |
download | rails-0206d9cb7c823fefbf3dfc1d1672be4628986c4e.tar.gz rails-0206d9cb7c823fefbf3dfc1d1672be4628986c4e.tar.bz2 rails-0206d9cb7c823fefbf3dfc1d1672be4628986c4e.zip |
Merge pull request #36671 from wjessop/do_not_validate_non_dirty_association_targets
Don't validate non dirty association targets
Diffstat (limited to 'activerecord/lib/active_record/autosave_association.rb')
-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 94d8134b55..734ebb45ae 100644 --- a/activerecord/lib/active_record/autosave_association.rb +++ b/activerecord/lib/active_record/autosave_association.rb @@ -302,7 +302,7 @@ module ActiveRecord def validate_single_association(reflection) association = association_instance_get(reflection.name) record = association && association.reader - association_valid?(reflection, record) if record + association_valid?(reflection, record) if record && record.changed_for_autosave? end # Validate the associated records if <tt>:validate</tt> or |