jhawthorn / discard

🃏🗑 Soft deletes for ActiveRecord done right

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not working with counter_cache

bragovo opened this issue · comments

https://guides.rubyonrails.org/association_basics.html#options-for-belongs-to-counter-cache

Everything fine while adding or reset but on discard nothing happening. Is it possible to recalc counter on discard automatically?

To my knowledge Rails doesn't directly support scoping the counter cache, so there's no easy way for the gem to directly support this. You'll like need to roll your own counter cache feature to support this.