diff options
author | Will Jessop <will@willj.net> | 2019-07-13 20:52:32 +0100 |
---|---|---|
committer | Will Jessop <will@willj.net> | 2019-07-15 18:21:20 +0100 |
commit | 6ea80b6103de9ef76dca9d51149dd94bec846642 (patch) | |
tree | a95a56cfd09163e4c79ac95af69d0afb467c2126 /activesupport/lib/active_support/time_with_zone.rb | |
parent | 88b91299f3fc5b912e10323ed0ad18c87c7584e5 (diff) | |
download | rails-6ea80b6103de9ef76dca9d51149dd94bec846642.tar.gz rails-6ea80b6103de9ef76dca9d51149dd94bec846642.tar.bz2 rails-6ea80b6103de9ef76dca9d51149dd94bec846642.zip |
Don't validate non dirty association targets
Fixes #36581.
This fixes an issue where validations would return differently when a previously saved invalid association was loaded between calls:
assert_equal true, squeak.valid?
assert_equal true, squeak.mouse.present?
assert_equal true, squeak.valid?
Here the second assert would return
Expected: true
Actual: false
Limiting validations to associations that would be normally saved (using autosave: true) due to changes means that loading invalid associated relations will not change the return value of the parent relations's `valid?` method.
Diffstat (limited to 'activesupport/lib/active_support/time_with_zone.rb')
0 files changed, 0 insertions, 0 deletions