Where/how can i adjust the Ember.Inflector Class / create an instance of it that ember-cli picks up?
Thanks!
I generated an initializer and put this data there. This ensures it loads before anything that might need it. Like the model, adapter, or serializer.
initializers/inflector.js
import Ember from 'ember';
export function initialize(/* container, application */) {
var inflector = Ember.Inflector.inflector;
inflector.uncountable('aamc-pcrs');
}
export default {
name: 'inflector',
initialize: initialize
};
I placed it in the model file and it worked fine:
import DS from 'ember-data';
import Ember from 'ember';
var inflector = Ember.Inflector.inflector;
inflector.irregular('nota', 'notas');
inflector.singular(/nota/, 'nota');
export default DS.Model.extend({
title: DS.attr('string'),
description: DS.attr('string'),
language: DS.attr('string'),
body: DS.attr('string')
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With