Rails select() and count() don't seem to play nice This is a bug in Rails 4.1. See https://github.com/rails/rails/issues/13648