fix rails 4.1 count with select queries using https://github.com/mislav/will_paginate/pull/372