Skip to content
  • Jacopo's avatar
    186474f2
    Fix counter_cache create/concat with overlapping counter_cache_column · 186474f2
    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: default avatarJean Boussier <jean.boussier@gmail.com>
    186474f2
    Fix counter_cache create/concat with overlapping counter_cache_column
    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: default avatarJean Boussier <jean.boussier@gmail.com>
Loading