Skip to content

crud generators ending with 's' blow up #3

@NeilBryant

Description

@NeilBryant
compound generate crud status

fs.js:338
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: ENOENT, no such file or directory '/data/home/nbryant/src/nodeapps/compound/cv/app/views/status/_form.ejs'

The controller is named incorrectly (singular statu_controller, rather than plural) and internally refers to 'statu'. Model is correct.

If I pluralize the command (compound g crud statuses), the controller, handler, etc all look correct, and only the model file is wrong (plural filename, plural object internally)... but there is only the one file to fix.

I took a stab at finding the problem, but didn't really get anywhere in the time I have. I see vendor/inflection.js and the rules look OK, but I'm not certain... are the first regexes stripping off 's' at the end of a word?

I've tried this with several other nouns: octopus, alias, bus, and all fail when scaffolded in the singular. Nouns not ending in 's' (ox, person, matrix) all work as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions