Skip to content
  • Sean Griffin's avatar
    15ddd517
    Don't skip in-memory insertion of associations when loaded in validate · 15ddd517
    Sean Griffin authored
    This was caused by 6d0d83a3. While the
    bug it's trying to fix is handled if the association is loaded in an
    after_(create|save) callback, it doesn't handle any cases that load the
    association before the persistence takes place (validation, or before_*
    filters). Instead of caring about the timing of persistence, we can just
    ensure that we're not double adding the record instead.
    
    The test from that commit actually broke, but it was not because the bug
    has been re-introduced. It was because `Bulb` in our test suite is doing
    funky things that look like STI but isn't STI, so equality comparison
    didn't happen as the loaded model was of a different class.
    
    Fixes #26661.
    15ddd517
    Don't skip in-memory insertion of associations when loaded in validate
    Sean Griffin authored
    This was caused by 6d0d83a3. While the
    bug it's trying to fix is handled if the association is loaded in an
    after_(create|save) callback, it doesn't handle any cases that load the
    association before the persistence takes place (validation, or before_*
    filters). Instead of caring about the timing of persistence, we can just
    ensure that we're not double adding the record instead.
    
    The test from that commit actually broke, but it was not because the bug
    has been re-introduced. It was because `Bulb` in our test suite is doing
    funky things that look like STI but isn't STI, so equality comparison
    didn't happen as the loaded model was of a different class.
    
    Fixes #26661.
Loading