Fix assignment factory associations and ID

The short ID must be unique but the words generated by Faker is not.

The two associations should be lazily loaded, or else in some cases an
assignment might get created with null values for these associations.