associate method

void associate(
  1. Model child,
  2. Model owner
)

Points child at owner (no save).

Implementation

void associate(Model child, Model owner) => child
  ..setAttr(morphType, Relation.morphClassOf(owner.modelDefinition))
  ..setAttr(foreignKey, owner.attributes[_keyOf(owner.modelDefinition)])
  ..setRelation(name, owner);