title: Rails Counter Cache
body: <p>I have a db schema with multiple counter caches.  Rather than have the counter caches spread across many tables, I'd like to have a table called user_counters with all of the various counter caches.  I'd update these caches from a service object with a method like this:</p>
  
  <pre><code>def update_user_counter(column, user_id)
    UserCounter.increment_counter(column, user_id)
  end
  </code></pre>
  
  <p>But, the UserCounter record for the associated user will most likely not have the same ID as the user.  What I'd like to do is something like this:</p>
  
  <pre><code>def update_user_counter(column, user_id)    
    UserCounter.increment_counter(column, UserCounter.where('user_id = "#{user_id}"')
  end
  </code></pre>
  
  <p>Any thoughts as to how I can accomplish this?  Thanks!!</p>