Skip to content
  • Adrianna Chang's avatar
    4199eeb8
    Add regression test for has_many_through associations failing to create join models · 4199eeb8
    Adrianna Chang authored
    This commit adds a test that demonstrates a regression in has_many_through associations
    where multiple has_many_through associations associate the same parent with the same
    child relation.
    
    The regression is ultimately caused by rails@0d38f2a, which avoids saving a through association target
    if we expect the target to be persisted by another (direct) association.
    
    The problem is that if we have multiple has_many_through associations that associate the same parent with the same
    child, we will autosave the first set of associations from the parent, but avoid saving the through target a second
    time (once it's persisted by the first association), and fail to create the join model for the second association chain.
    4199eeb8
    Add regression test for has_many_through associations failing to create join models
    Adrianna Chang authored
    This commit adds a test that demonstrates a regression in has_many_through associations
    where multiple has_many_through associations associate the same parent with the same
    child relation.
    
    The regression is ultimately caused by rails@0d38f2a, which avoids saving a through association target
    if we expect the target to be persisted by another (direct) association.
    
    The problem is that if we have multiple has_many_through associations that associate the same parent with the same
    child, we will autosave the first set of associations from the parent, but avoid saving the through target a second
    time (once it's persisted by the first association), and fail to create the join model for the second association chain.
Loading