Skip to content
  • Will Jessop's avatar
    6ea80b61
    Don't validate non dirty association targets · 6ea80b61
    Will Jessop authored
    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.
    6ea80b61
    Don't validate non dirty association targets
    Will Jessop authored
    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.
Loading