Update select_for_count to support AR 4.0.1