create method
Creates a related model with the foreign key set.
Implementation
Future<R> create(
Model parent,
DatabaseManager db,
Map<String, Object?> attributes,
) async {
final model = related.newInstance(attributes, db)
..setAttr(foreignKey, parent.attributes[localKey]);
await model.save();
return model;
}