-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Cannot remove use of inflector #3873
Comments
@jnfingerle this seems like a reasonable request. Would you have time to implement a patch that supported option b? |
@bmac Yes, I can give that a try, but I'm on vacation right now, so this will have to wait two weeks before I can start working on it. |
@bmac what if the store used the inflector as a service? Just a thought. |
Back from vacation ... @fivetanley Could you elaborate on your proposal? My idea was making the inflector an overwritable property of the store, yet I haven't tried out which walls I might hit on my way. |
ping @fivetanley |
I also want to get rid of the inflector. There are about 2500 languages in the world. The inflector works for 0.0004% ;) I remember that even in english the inflector was a constant source of pain because it produced some unexpected result. What's so bad with always singular? At the moment I'm trying to get a software done in german. It's hard! Overwriting not only all of ember-data serializer but also all stuff in ember-cli-mirage. |
To disable the inflector, I believe the following (in your // app.js
Ember.Inflector.inflector = new Ember.Inflector() |
Thank you! It works! In app.js it must be placed after "loadInitializers(...)". This is the drop-in initializer solution: At app/initializers/inflector.js
|
For a project I'm working on, we've decided to not use pluralized forms at all (partly because it doesn't get easier in German, partly because that's what the back end does anyway). I got rid of most of it through the hooks in the RESTAdapter/RESTSerializer.
Unfortunately the inflectors is also used by the store through relationship-meta.js. This is a great way to shoot myself in the foot for german words that the inflector believes to be an english plural form.
What's more, there is no public api to remove rules from the inflector, only to add additional ones.
Now, this is a request for a clean solution using either (a) a hook to replace
typeForRelationshipMeta()
with my own implementation or (b) a hook to replace the inflector for all things ember-data with my own version.If there is a blessed way to do this and that I'm missing here, I'd be greatful to be pointed into the right direction.
The text was updated successfully, but these errors were encountered: