fix count with distinct in associations in rails4, it was loading whole association