Skip to content
  • Ryuta Kamizono's avatar
    cad0b7d9
    Fix `touch` option to behave consistently with `Persistence#touch` method · cad0b7d9
    Ryuta Kamizono authored
    `touch` option was added to `increment!` (#27660) and `update_counters`
    (#26995). But that option behaves inconsistently with
    `Persistence#touch` method.
    
    If `touch` option is passed attribute names, it won't update
    update_at/on attributes unlike `Persistence#touch` method.
    
    Due to changed from `Persistence#touch` to `increment!` with `touch`
    option, #31405 has a regression that `counter_cache` with `touch` option
    which is passed attribute names won't update update_at/on attributes.
    
    I think that the inconsistency is not intended. To get back consistency,
    ensure that `touch` option updates update_at/on attributes.
    cad0b7d9
    Fix `touch` option to behave consistently with `Persistence#touch` method
    Ryuta Kamizono authored
    `touch` option was added to `increment!` (#27660) and `update_counters`
    (#26995). But that option behaves inconsistently with
    `Persistence#touch` method.
    
    If `touch` option is passed attribute names, it won't update
    update_at/on attributes unlike `Persistence#touch` method.
    
    Due to changed from `Persistence#touch` to `increment!` with `touch`
    option, #31405 has a regression that `counter_cache` with `touch` option
    which is passed attribute names won't update update_at/on attributes.
    
    I think that the inconsistency is not intended. To get back consistency,
    ensure that `touch` option updates update_at/on attributes.
Loading