Files
openfoodnetwork/app/models
Pau Perez be6c8be07a Handle soft deleted products when refreshing cache
Since cd3add960e Spree soft-deletes products and as such the models not
destroyed but updated setting a value for the `deleted_at` field.

This turns what used to be deletes into updates thus triggering AR's
update callbacks instead of the destroy ones. As a result, this bypasses
the logic to refresh the products cache on destroy and hits the
`after_save` callback.

Furthermore, since act_as_paranoid (the soft-delete gem Spree uses) uses
a default scope to avoid retrieving soft-deleted records we need to
purposefully fetch them in order to refresh the cache.
2018-12-14 15:13:06 +01:00
..
2012-03-27 10:10:26 +11:00
2014-12-12 13:33:14 +11:00
2014-12-12 13:33:14 +11:00
2018-11-09 13:33:11 +11:00