ankane/hightop — pull request #2 by hakunin (2014-09-12 09:31:56+00:00)
Title: fix for ActiveRecord column mangling

```
❯ VideoCount.top(:event_id)
PG::Error: ERROR: column "event_id_id" does not exist
SELECT COUNT(*) AS count_all, event_id_id AS event_id_id FROM "video_counts" WHERE (event_id IS NOT NULL) GROUP BY event_id_id ORDER BY count_all DESC, event_id
```

For some reason, activerecord would replace `event_id` with `event_id_id`. This would only happen on `event_id` and not `video_id`, which worked find.

I tried hand-creating the same query with ActiveRecord and found the issue was not in Hightop, but AR itself (or somehow my fault, but I can't imagine how this could be).

So my rationale was, if I specify the `tablename.colname` to Activerecord, it may stop toying with my attributes, and it did.

I lack the knowledge or time to dive deep into this. If you think this fix is useful, accept it, or let me know if you know better :)