Replacement for ActiveRecord belongs_to :counter_cache with ability to specify conditions.