Fix weird unique has_many count bug we're seeing

Opening this with just a failing test so I can dig into this a bit deeper.

cc @rsanheim @github/rails3