From 3549246ad57b65037d48592945011d64a1c5e8f2 Mon Sep 17 00:00:00 2001 From: Romain Lanz <2793951+RomainLanz@users.noreply.github.com> Date: Tue, 23 Aug 2022 09:42:02 +0200 Subject: [PATCH] fix(instruction): modelName should be PascalCase and modelReference should be camelCase (#206) Closes https://github.com/adonisjs/auth/issues/205 --- instructions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instructions.ts b/instructions.ts index 1e12dc2..08c1535 100644 --- a/instructions.ts +++ b/instructions.ts @@ -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)