-
Jacopo authored
Fix when multiple `belongs_to` maps to the same counter_cache column. In such situation `inverse_which_updates_counter_cache` may find the wrong relation which leads into an invalid increment of the counter_cache. This is done by releying on the `inverse_of` property of the relation as well as comparing the models the association points two. Note however that this second check doesn't work for polymorphic associations. Fixes #41250 Co-Authored-By:
Jean Boussier <jean.boussier@gmail.com>
Jacopo authoredFix when multiple `belongs_to` maps to the same counter_cache column. In such situation `inverse_which_updates_counter_cache` may find the wrong relation which leads into an invalid increment of the counter_cache. This is done by releying on the `inverse_of` property of the relation as well as comparing the models the association points two. Note however that this second check doesn't work for polymorphic associations. Fixes #41250 Co-Authored-By:
Jean Boussier <jean.boussier@gmail.com>
Loading