Skip to content

Commit

Permalink
refactor: update exception message occurred during Model.refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Jan 12, 2020
1 parent 84761e6 commit d050ecc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Orm/BaseModel/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1324,13 +1324,13 @@ export class BaseModel implements ModelContract {
if (!freshModelInstance) {
throw new Exception(
[
'"Model.reload" failed. ',
'"Model.refresh" failed. ',
`Unable to lookup "${$table}" table where "${primaryAdapterKey}" = ${this.$primaryKeyValue}`,
].join(''),
)
}

this.fill(freshModelInstance!.$attributes)
this.fill(freshModelInstance.$attributes)
this.$hydrateOriginals()
}
}
2 changes: 1 addition & 1 deletion test/orm/base-model.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ test.group('Base Model | persist', (group) => {
try {
await user.refresh()
} catch ({ message }) {
assert.equal(message, '"Model.reload" failed. Unable to lookup "users" table where "id" = 1')
assert.equal(message, '"Model.refresh" failed. Unable to lookup "users" table where "id" = 1')
}
})
})
Expand Down

0 comments on commit d050ecc

Please sign in to comment.