loadMissing method

Future<OrmMigrationRecord> loadMissing(
  1. Iterable<String> relations
)
inherited

Lazily loads multiple relations that haven't been loaded yet.

Similar to Laravel's $model->loadMissing(['relation1', 'relation2']).

Only loads relations that aren't already loaded.

Example:

await post.loadMissing(['author', 'tags', 'comments']);

Implementation

Future<TModel> loadMissing(Iterable<String> relations) async {
  for (final relation in relations) {
    if (!_asRelations.relationLoaded(relation)) {
      await load(relation);
    }
  }
  return _self();
}