Skip to content

Commit 73b3853

Browse files
committed
Pass adapterResult to column consume function
1 parent e2ef286 commit 73b3853

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/orm/base_model/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1707,7 +1707,7 @@ class BaseModelImpl implements LucidRow {
17071707
*/
17081708
const value =
17091709
typeof attribute.consume === 'function'
1710-
? attribute.consume(adapterResult[key], attributeName, this)
1710+
? attribute.consume(adapterResult[key], attributeName, this, adapterResult)
17111711
: adapterResult[key]
17121712

17131713
/**

src/types/model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ export type ColumnOptions = {
222222
/**
223223
* Invoked when row is fetched from the database
224224
*/
225-
consume?: (value: any, attribute: string, model: LucidRow) => any
225+
consume?: (value: any, attribute: string, model: LucidRow, adapterResult: ModelObject) => any
226226
}
227227

228228
/**

0 commit comments

Comments
 (0)