Make sure model definition is built when attaching to a DS

/to @ritch 

The problem is found when a model class is re-attached to a different DS during test.