Skip to content

Commit 3d277b6

Browse files
committed
refactor: fix commands description and model template
1 parent b440d02 commit 3d277b6

File tree

7 files changed

+17
-10
lines changed

7 files changed

+17
-10
lines changed

commands/Make/Command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default class MakeCommand extends BaseGenerator {
3030
public static commandName = 'make:command'
3131
public static description = 'Make a new ace command'
3232

33-
@args.string({ description: 'Make of the command class' })
33+
@args.string({ description: 'Name of the command class' })
3434
public name: string
3535

3636
/**

commands/Make/Controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ export default class MakeController extends BaseGenerator {
3535
public static commandName = 'make:controller'
3636
public static description = 'Make a new HTTP controller'
3737

38-
@args.string({ description: 'Make of the controller class' })
38+
@args.string({ description: 'Name of the controller class' })
3939
public name: string
4040

41-
@flags.boolean({ description: 'Add resourceful methods to the controller class', alias: 'r' })
41+
@flags.boolean({ description: 'Adds resourceful methods to the controller class', alias: 'r' })
4242
public resource: boolean
4343

4444
/**

commands/Make/Middleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default class MakeMiddleware extends BaseGenerator {
2929
public static commandName = 'make:middleware'
3030
public static description = 'Make a new middleware'
3131

32-
@args.string({ description: 'Make of the middleware class' })
32+
@args.string({ description: 'Name of the middleware class' })
3333
public name: string
3434

3535
/**

commands/Make/Model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default class MakeModel extends BaseGenerator {
3030
public static commandName = 'make:model'
3131
public static description = 'Make a new Lucid model'
3232

33-
@args.string({ description: 'Make of the model class' })
33+
@args.string({ description: 'Name of the model class' })
3434
public name: string
3535

3636
/**

commands/Make/Provider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ export default class MakeProvider extends BaseGenerator {
3434
public static commandName = 'make:provider'
3535
public static description = 'Make a new IoC container provider'
3636

37-
@args.string({ description: 'Make of the provider class' })
37+
@args.string({ description: 'Name of the provider class' })
3838
public name: string
3939

40-
@flags.boolean({ description: 'Register provider under the ace providers array' })
40+
@flags.boolean({ description: 'Registers provider under the ace providers array' })
4141
public ace: boolean
4242

4343
/**

commands/Make/Validator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default class MakeValidator extends BaseGenerator {
3030
public static commandName = 'make:validator'
3131
public static description = 'Make a new validator'
3232

33-
@args.string({ description: 'Name of the validator' })
33+
@args.string({ description: 'Name of the validator class' })
3434
public name: string
3535

3636
/**

templates/model.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1+
import { DateTime } from 'luxon'
12
import { BaseModel, column } from '@ioc:Adonis/Lucid/Orm'
23

34
export default class ${filename} extends BaseModel {
45
@column({ isPrimary: true })
56
public id: number
67

78
public static $columns: Pick<
8-
filename,
9-
'id'
9+
${filename},
10+
'id' | 'createdAt' | 'updatedAt'
1011
>
12+
13+
@column.dateTime({ autoCreate: true })
14+
public createdAt: DateTime
15+
16+
@column.dateTime({ autoCreate: true, autoUpdate: true })
17+
public updatedAt: DateTime
1118
}

0 commit comments

Comments
 (0)