emberjs/ember-inflector

Irregular Singularize of "Drives"

southpolesteve opened this issue · 3 comments

Not sure if this is the proper place to report, but ran into this issue today:

var inflector = Ember.Inflector.inflector;
inflector.singularize('drives')
// > "drife"

I'm also happy to take a crack at fixing this, but just wanted to ensure this fix actually belongs upstream and not in the app itself

some context:

the goal of this project is to

  • provide the infrastructure for basic inflection
  • provide default inflection rules that match those of ActiveSupport – which has frozen its inflection rules
  • provide users the way to augment the base inflection rules.
  % bundle exec rails c                                                                         !13314
Loading development environment (Rails 4.2.1)
 :001 > "drives".singularize
 => "drife"
 :002 >

So the solution is for your application to specify the preference using inflector.irregular(x,y)

relevant docs: https://github.com/stefanpenner/ember-inflector/blob/master/addon/lib/system/inflector.js#L32-L84

Ah ok. That makes sense. Thanks for the quick reply!

Ah ok. That makes sense. Thanks for the quick reply!

no problem. It is in-fact strange, but english is a strange thing. :P