N+1 count query killer for ActiveRecord