Custom counter_cache functionality that supports conditions and multiple models.