Includes HABTM returns correct size now. Fixes #16032 and #15244 for master

    Includes HABTM returns correct size now. It's caused by the join dependency only instantiates one HABTM object because the join table hasn't a primary key.
    Updated commit and test fixed from @bigxiang commit dbaa837

    Fixes #16032.

    Examples:

        before:

        Project.first.salaried_developers.size # => 3
        Project.includes(:salaried_developers).first.salaried_developers.size # => 1

        after:

        Project.first.salaried_developers.size # => 3
        Project.includes(:salaried_developers).first.salaried_developers.size # => 3
Sorry, I was answering both comments at same time becuase I thought they were the same. ar_parent.id || ar_parent can be changed to ar_parent and tests passes, although primary_key branch can't be removed by the reason I commented previously, row_hash is not an instantiated model yet, only attributes hash.