Skip to content
  • Victor Perez Rodriguez's avatar
    396b43a9
    touch parent model when an attachment is purged · 396b43a9
    Victor Perez Rodriguez authored
    Currently `delete` is used on the `purge` and `purge_later` methods,
    that prevent any callbacks to be triggered which causes the parent
    model to not be updated when an attachment is purged. This behaviour
    cause issues on some caching strategies as reported here: https://github.com/rails/rails/issues/39858
    
    Changes:
    
    * Add `record&.touch` on `attachment#purge`
    * Add `record&.touch` on `attachment#purge_later`
    * Remove extra blank line on attachment.rb
    * Add tests which are failing before this change and pass after the change
    396b43a9
    touch parent model when an attachment is purged
    Victor Perez Rodriguez authored
    Currently `delete` is used on the `purge` and `purge_later` methods,
    that prevent any callbacks to be triggered which causes the parent
    model to not be updated when an attachment is purged. This behaviour
    cause issues on some caching strategies as reported here: https://github.com/rails/rails/issues/39858
    
    Changes:
    
    * Add `record&.touch` on `attachment#purge`
    * Add `record&.touch` on `attachment#purge_later`
    * Remove extra blank line on attachment.rb
    * Add tests which are failing before this change and pass after the change
Loading