preventLazyLoading property

bool preventLazyLoading
getter/setter pair

When true, accessing a relation that was not eager loaded throws instead of querying lazily (catches N+1 problems in tests).

Implementation

static bool preventLazyLoading = false;