Skip to content

Normalize mixin names - #229

Closed
fabien wants to merge 1 commit into
loopbackio:masterfrom
fabien:fix/normalize-mixins
Closed

Normalize mixin names#229
fabien wants to merge 1 commit into
loopbackio:masterfrom
fabien:fix/normalize-mixins

Conversation

@fabien

@fabien fabien commented Aug 18, 2014

Copy link
Copy Markdown
Contributor

See #218 - strongloop/loopback-boot#33 will be updated next.

@bajtos

bajtos commented Aug 19, 2014

Copy link
Copy Markdown
Member

@fabien could you please provide more details? How the user code looks before the change, how will it look with this change in place, what are the benefits, etc.

@bajtos

bajtos commented Aug 20, 2014

Copy link
Copy Markdown
Member

I am personally rather opposed to the idea of modifying identifiers here in the juggler. As far as juggler is concerned, there should be only one mixin id (name) - same as there is only one model id (name).

Normalization of mixin names should happen in loopback-boot.

@fabien

fabien commented Aug 20, 2014

Copy link
Copy Markdown
Contributor Author

@bajtos I actually had the normalization code in loopback-boot before. I'll move it back there then.

@bajtos

bajtos commented Aug 20, 2014

Copy link
Copy Markdown
Member

Cool, let's close this pull request then.

@bajtos bajtos closed this Aug 20, 2014
@fabien

fabien commented Aug 20, 2014

Copy link
Copy Markdown
Contributor Author

@bajtos turns out that rejecting this PR constrains mixin names to only be referred to by their ClassNamed naming format - that doesn't sit well with me. I prefer lower-cased, dasherized for example. So unless we do this in loopback-boot, there's no way to do this.

IIRC you're able to refer to a model using different naming format? Or has this been deprecated?

@bajtos

bajtos commented Aug 20, 2014

Copy link
Copy Markdown
Member

IIRC you're able to refer to a model using different naming format?

The code in modelBuilder.getModel does not seem to support that.

constrains mixin names to only be referred to by their ClassNamed naming format

Well, it constrains you to refer by the same name you used when the mixin was defined.

I prefer lower-cased, dasherized for example. So unless we do this in loopback-boot, there's no way to do this.

Let's discuss this in strongloop/loopback-boot#33 then.

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

Successfully merging this pull request may close these issues.

2 participants