Skip to content

Commit

Permalink
refactor(orm): remove useless check in loadOnce
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainLanz committed Sep 5, 2024
1 parent e4af8c0 commit 8ad14a1
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/orm/base_model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1807,12 +1807,6 @@ class BaseModelImpl implements LucidRow {
* already preloaded
*/
async loadOnce(relationName: any) {
this.ensureIsntDeleted()

if (!this.$isPersisted) {
throw new Exception('Cannot lazy load relationship for an unpersisted model instance')
}

if (!this.$preloaded[relationName]) {
return this.load(relationName)
}
Expand Down

0 comments on commit 8ad14a1

Please sign in to comment.