uses model.all if rails version >= 4.1