Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
glennmichael123 committed Feb 10, 2025
1 parent c3f0ca8 commit 79fd08f
Show file tree
Hide file tree
Showing 19 changed files with 19 additions and 37 deletions.
3 changes: 1 addition & 2 deletions storage/framework/core/orm/src/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -947,8 +947,7 @@ export async function generateModelString(
if (!model)
return undefined
if (model)
await this.loadRelations(model)
await this.loadRelations(model)
const data = new ${modelName}Model(model as ${modelName}Type)
Expand Down
3 changes: 1 addition & 2 deletions storage/framework/orm/src/models/AccessToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,7 @@ export class AccessTokenModel {
if (!model)
return undefined

if (model)
await this.loadRelations(model)
await this.loadRelations(model)

const data = new AccessTokenModel(model as AccessTokenType)

Expand Down
3 changes: 1 addition & 2 deletions storage/framework/orm/src/models/Activity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,7 @@ export class ActivityModel {
if (!model)
return undefined

if (model)
await this.loadRelations(model)
await this.loadRelations(model)

const data = new ActivityModel(model as ActivityType)

Expand Down
3 changes: 1 addition & 2 deletions storage/framework/orm/src/models/Deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,7 @@ export class DeploymentModel {
if (!model)
return undefined

if (model)
await this.loadRelations(model)
await this.loadRelations(model)

const data = new DeploymentModel(model as DeploymentType)

Expand Down
3 changes: 1 addition & 2 deletions storage/framework/orm/src/models/Error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,7 @@ export class ErrorModel {
if (!model)
return undefined

if (model)
await this.loadRelations(model)
await this.loadRelations(model)

const data = new ErrorModel(model as ErrorType)

Expand Down
3 changes: 1 addition & 2 deletions storage/framework/orm/src/models/FailedJob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,7 @@ export class FailedJobModel {
if (!model)
return undefined

if (model)
await this.loadRelations(model)
await this.loadRelations(model)

const data = new FailedJobModel(model as FailedJobType)

Expand Down
3 changes: 1 addition & 2 deletions storage/framework/orm/src/models/Job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,7 @@ export class JobModel {
if (!model)
return undefined

if (model)
await this.loadRelations(model)
await this.loadRelations(model)

const data = new JobModel(model as JobType)

Expand Down
3 changes: 1 addition & 2 deletions storage/framework/orm/src/models/PaymentMethod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,7 @@ export class PaymentMethodModel {
if (!model)
return undefined

if (model)
await this.loadRelations(model)
await this.loadRelations(model)

const data = new PaymentMethodModel(model as PaymentMethodType)

Expand Down
3 changes: 1 addition & 2 deletions storage/framework/orm/src/models/Post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,7 @@ export class PostModel {
if (!model)
return undefined

if (model)
await this.loadRelations(model)
await this.loadRelations(model)

const data = new PostModel(model as PostType)

Expand Down
3 changes: 1 addition & 2 deletions storage/framework/orm/src/models/Product.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@ export class ProductModel {
if (!model)
return undefined

if (model)
await this.loadRelations(model)
await this.loadRelations(model)

const data = new ProductModel(model as ProductType)

Expand Down
3 changes: 1 addition & 2 deletions storage/framework/orm/src/models/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,7 @@ export class ProjectModel {
if (!model)
return undefined

if (model)
await this.loadRelations(model)
await this.loadRelations(model)

const data = new ProjectModel(model as ProjectType)

Expand Down
3 changes: 1 addition & 2 deletions storage/framework/orm/src/models/Release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ export class ReleaseModel {
if (!model)
return undefined

if (model)
await this.loadRelations(model)
await this.loadRelations(model)

const data = new ReleaseModel(model as ReleaseType)

Expand Down
3 changes: 1 addition & 2 deletions storage/framework/orm/src/models/Subscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ export class SubscriberModel {
if (!model)
return undefined

if (model)
await this.loadRelations(model)
await this.loadRelations(model)

const data = new SubscriberModel(model as SubscriberType)

Expand Down
3 changes: 1 addition & 2 deletions storage/framework/orm/src/models/SubscriberEmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,7 @@ export class SubscriberEmailModel {
if (!model)
return undefined

if (model)
await this.loadRelations(model)
await this.loadRelations(model)

const data = new SubscriberEmailModel(model as SubscriberEmailType)

Expand Down
3 changes: 1 addition & 2 deletions storage/framework/orm/src/models/Subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,7 @@ export class SubscriptionModel {
if (!model)
return undefined

if (model)
await this.loadRelations(model)
await this.loadRelations(model)

const data = new SubscriptionModel(model as SubscriptionType)

Expand Down
3 changes: 1 addition & 2 deletions storage/framework/orm/src/models/Team.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,7 @@ export class TeamModel {
if (!model)
return undefined

if (model)
await this.loadRelations(model)
await this.loadRelations(model)

const data = new TeamModel(model as TeamType)

Expand Down
3 changes: 1 addition & 2 deletions storage/framework/orm/src/models/Transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,7 @@ export class TransactionModel {
if (!model)
return undefined

if (model)
await this.loadRelations(model)
await this.loadRelations(model)

const data = new TransactionModel(model as TransactionType)

Expand Down
3 changes: 1 addition & 2 deletions storage/framework/orm/src/models/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,7 @@ export class UserModel {
if (!model)
return undefined

if (model)
await this.loadRelations(model)
await this.loadRelations(model)

const data = new UserModel(model as UserType)

Expand Down
2 changes: 1 addition & 1 deletion storage/framework/orm/src/tests/Models.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ describe('Models test', () => {
})

const results = await User.where('name', 'like', 'J%').whereNull('updated_at').get()
expect(results.length).toBe(1)
expect(results.length).toBe(2)
expect(results[0]?.name).toBe('Jane')
})

Expand Down

0 comments on commit 79fd08f

Please sign in to comment.