jinzhu/gorm — pull request #300 by jnfeinstein (2014-11-25 19:48:51+00:00)
Title: .Count() should always use ToSnake'd foreign keys.

It looks like gorm always uses the snake form of a column by
convention, as seen by searching DBName in scope.go. These counts
were erroring out without the ToSnake'd foreign keys.

Further, the code for has_many and has_one becomes the same (which
makes sense), so I combined the two cases.