Skip to content

Commit

Permalink
fix(instruction): modelName should be PascalCase and modelReference s…
Browse files Browse the repository at this point in the history
…hould be camelCase (#206)

Closes #205
  • Loading branch information
RomainLanz authored Aug 23, 2022
1 parent 6661cdc commit 3549246
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions instructions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,9 @@ export default async function instructions(
*/
if (state.provider === 'lucid') {
const modelName = await getModelName(sink)
state.modelName = modelName.replace(/(\.ts|\.js)$/, '')
state.modelName = string.pascalCase(string.singularize(modelName.replace(/(\.ts|\.js)$/, '')))
state.usersTableName = string.pluralize(string.snakeCase(state.modelName))
state.modelReference = string.pascalCase(string.singularize(state.modelName))
state.modelReference = string.camelCase(string.singularize(state.modelName))
state.modelNamespace = `${app.namespacesMap.get('models') || 'App/Models'}/${state.modelName}`
} else {
state.usersTableName = await getTableName(sink)
Expand Down

0 comments on commit 3549246

Please sign in to comment.