File tree Expand file tree Collapse file tree 6 files changed +16
-2
lines changed Expand file tree Collapse file tree 6 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -1175,7 +1175,9 @@ export async function generateModelString(
1175
1175
if ( relationType === 'belongsType' && ! relationCount ) {
1176
1176
const relationName = camelCase ( relation . relationName || formattedModelRelation )
1177
1177
1178
- fieldString += `${ relationName } ?: any\n`
1178
+ declareFields += `public ${ snakeCase ( relationName ) } : any\n`
1179
+ constructorFields += `this.${ snakeCase ( relationName ) } = ${ formattedModelName } ?.${ snakeCase ( relationName ) } \n`
1180
+ fieldString += `${ snakeCase ( relationName ) } ?: any\n`
1179
1181
relationString += `
1180
1182
model.${ relationName } = await instance.${ relationName } ()\n
1181
1183
`
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ export class DeploymentModel {
61
61
protected updateFromQuery : any
62
62
protected deleteFromQuery : any
63
63
protected hasSelect : boolean
64
+ public user : any
64
65
public id : number
65
66
public uuid : string | undefined
66
67
public commit_sha : string | undefined
@@ -76,6 +77,7 @@ export class DeploymentModel {
76
77
public user_id : number | undefined
77
78
78
79
constructor ( deployment : Partial < DeploymentType > | null ) {
80
+ this . user = deployment ?. user
79
81
this . id = deployment ?. id || 1
80
82
this . uuid = deployment ?. uuid
81
83
this . commit_sha = deployment ?. commit_sha
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ export class PaymentMethodModel {
64
64
protected updateFromQuery : any
65
65
protected deleteFromQuery : any
66
66
protected hasSelect : boolean
67
+ public user : any
67
68
public id : number
68
69
public uuid : string | undefined
69
70
public type : string | undefined
@@ -80,6 +81,7 @@ export class PaymentMethodModel {
80
81
public transaction_id : number | undefined
81
82
82
83
constructor ( paymentmethod : Partial < PaymentMethodType > | null ) {
84
+ this . user = paymentmethod ?. user
83
85
this . id = paymentmethod ?. id || 1
84
86
this . uuid = paymentmethod ?. uuid
85
87
this . type = paymentmethod ?. type
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ export class PostModel {
54
54
protected updateFromQuery : any
55
55
protected deleteFromQuery : any
56
56
protected hasSelect : boolean
57
+ public user : any
57
58
public id : number
58
59
public title : string | undefined
59
60
public body : string | undefined
@@ -63,6 +64,7 @@ export class PostModel {
63
64
public user_id : number | undefined
64
65
65
66
constructor ( post : Partial < PostType > | null ) {
67
+ this . user = post ?. user
66
68
this . id = post ?. id || 1
67
69
this . title = post ?. title
68
70
this . body = post ?. body
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ export class SubscriptionModel {
64
64
protected updateFromQuery : any
65
65
protected deleteFromQuery : any
66
66
protected hasSelect : boolean
67
+ public user : any
67
68
public id : number
68
69
public uuid : string | undefined
69
70
public type : string | undefined
@@ -82,6 +83,7 @@ export class SubscriptionModel {
82
83
public user_id : number | undefined
83
84
84
85
constructor ( subscription : Partial < SubscriptionType > | null ) {
86
+ this . user = subscription ?. user
85
87
this . id = subscription ?. id || 1
86
88
this . uuid = subscription ?. uuid
87
89
this . type = subscription ?. type
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import User from './User'
11
11
export interface TransactionsTable {
12
12
id ?: number
13
13
user ?: any
14
- paymentMethod ?: any
14
+ payment_method ?: any
15
15
name ?: string
16
16
description ?: string
17
17
amount ?: number
@@ -63,6 +63,8 @@ export class TransactionModel {
63
63
protected updateFromQuery : any
64
64
protected deleteFromQuery : any
65
65
protected hasSelect : boolean
66
+ public user : any
67
+ public payment_method : any
66
68
public id : number
67
69
public uuid : string | undefined
68
70
public name : string | undefined
@@ -77,6 +79,8 @@ export class TransactionModel {
77
79
public paymentmethod_id : number | undefined
78
80
79
81
constructor ( transaction : Partial < TransactionType > | null ) {
82
+ this . user = transaction ?. user
83
+ this . payment_method = transaction ?. payment_method
80
84
this . id = transaction ?. id || 1
81
85
this . uuid = transaction ?. uuid
82
86
this . name = transaction ?. name
You can’t perform that action at this time.
0 commit comments