Skip to content
  • Ryuta Kamizono's avatar
    cbb19eb8
    Fix complicated has_many through with nested where condition · cbb19eb8
    Ryuta Kamizono authored
    #40779 will be caused if (1) having nested where condition for through
    association, and (2) through scope has references values, and (3) the
    model has no association which is the same name with table name.
    
    In that case, the join root will be found by the table name but the join
    root isn't related with association reflection.
    
    This changes to return the table klass from join dependency tree, it
    works regardless of whether the join root or join association children.
    
    Fixes #40779.
    cbb19eb8
    Fix complicated has_many through with nested where condition
    Ryuta Kamizono authored
    #40779 will be caused if (1) having nested where condition for through
    association, and (2) through scope has references values, and (3) the
    model has no association which is the same name with table name.
    
    In that case, the join root will be found by the table name but the join
    root isn't related with association reflection.
    
    This changes to return the table klass from join dependency tree, it
    works regardless of whether the join root or join association children.
    
    Fixes #40779.
Loading