Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generator not pluralizing module names properly #205

Open
jamviking opened this issue Mar 7, 2016 · 6 comments
Open

Generator not pluralizing module names properly #205

jamviking opened this issue Mar 7, 2016 · 6 comments

Comments

@jamviking
Copy link

grunt failed in tests/server/routes.test on module named "party" being pluralized as "partys" and "parties" at line 89.

        // Get a list of Parties
        agent.get('/api/parties')
          .end(function (partysGetErr, partysGetRes) {
            // Handle Party save error
            if (partysGetErr) {
              return done(partysGetErr);
            }

            // Get Parties list
            var parties = partiesGetRes.body;

            // Set assertions
            (parties[0].user._id).should.equal(userId);
            (parties[0].name).should.match('Party name');

            // Call the assertion callback
            done();
          });
@codydaig
Copy link
Member

codydaig commented Mar 7, 2016

Which sub generator is producing this?

@jamviking
Copy link
Author

meanjs:crud-module

On Mon, Mar 7, 2016 at 10:51 AM, Cody B. Daig notifications@github.com
wrote:

Which sub generator is producing this?


Reply to this email directly or view it on GitHub
#205 (comment)
.

@Ariestattoo
Copy link

This is a result of the underscore.inflections module in the crud module index.js

  this.name = props.name;
  this.slugifiedName = s(this.name).slugify().value();

  this.slugifiedPluralName = inflections.pluralize(this.slugifiedName);
  this.slugifiedSingularName = inflections.singularize(this.slugifiedName);

Inflections does have support for adding irregular words, however I have added it in several places including the global modules for the generator and it does not seem to take which may be my misunderstanding of how the generator works.

@jamviking
Copy link
Author

I think I found the bug in the server route tests template...How do i go about creating a pull request for the fix (am a git/javascript newbie)?

@jamviking
Copy link
Author

I figured how to create the PR...just one silly mistake...did not create a branch for the fix first..

@keithics
Copy link

@Ariestattoo Other than irregular words, it is only limited to English language.

i think it's better to have an option to choose the plural and singular term for each module.
And we will use the inflections as a default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants