https://github.com/cedric/custom_counter_cache
Ruby60
last year
Custom counter_cache functionality that supports conditions and multiple models.
MIT License