-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
Allow pluralization to be configurable. #68
Conversation
@stefanpenner - 👍 ? |
Also, I split the commits, you can see the actual changes in the first one (the second is just updating |
To customize provide a `pluralizedTypes` object to your extended version of the Resolver: ```javascript import Resolver from 'ember/resolver'; export default Resolver.extend({ pluralizedTypes: { 'sheep': 'sheep' 'config': 'config' } }) ```
LGTM |
Allow pluralization to be configurable.
Tagged and released as 0.1.8. |
👍 |
Where would one extend the Resolver in an Ember CLI application? I've searched but can't find anything about this in the docs or stack overflow. |
You can put it anywhere you want then change the import in app/app.js to import your custom resolver and pass it into the app there. |
Is there a way to extend pluralizedTypes multiple times? Maybe it's more an Ember question... I'm using ember-can addon, which adds its own pluralizedTypes. Then I add my pluralizedTypes. I have to somehow merge them together. Now I use this rather awful approach: ResolverInitializer = {
name: "resolver",
after: "setup-ember-can",
initialize: function(container, application) {
Resolver.reopen({
pluralizedTypes: $.extend(Resolver.create().get("pluralizedTypes"), {
search: "searches",
"value-object": "value-objects"
})
});
}
}; I'm not sure, but it seems that this pluralizedTypes implementation is hard to extend. For example if I use another addon that adds its own pluralizedTypes the same way ember-can does, they won't work together. |
Move loader.js into subdirectory.
To customize provide a
pluralizedTypes
object to your extended version ofthe Resolver: