relationLoaded method

bool relationLoaded(
  1. String name
)
inherited

Checks if a relation has been loaded.

Returns true even if the loaded value is null or an empty list.

Example:

if (post.relationLoaded('author')) {
  print('Author already loaded');
}

Implementation

bool relationLoaded(String name) {
  final loaded = _loadedRelations[this];
  return loaded != null && loaded.contains(name);
}