Skip to content

Confusing Code in ModelRegistry #127

@skilesare

Description

@skilesare

The following code in the ModelRegistry constructor doesn't seem to make sense. In the callback modelName is actually the index for the lodash _.foreach function

Seems like it should be this.registerMode(model,model.modelName). Maybe you are meaning to name things as the index, but later you try to humanize this term. I keep getting an error when you call capitalize on the 0(the index of the first item). I guess I'd pass this if I had a label on my model, but I don't.

_.forEach(models, function (model, modelName) {
    this.registerModel(model, modelName);
    _.forEach(model.discriminators, function (discModel, discName) {
        this.registerModel(discModel, discName, {hidden: true});
    }.bind(this));
}.bind(this));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions