Skip to content
Browse files

Merge pull request #213 from panarom/master

correct singularization of status (and alias)
  • Loading branch information...
2 parents 230a1d3 + d8216cf commit 8510666625e6173b4af02b6d43f3a0ccacb87e74 @solnic solnic committed
Showing with 17 additions and 1 deletion.
  1. +1 −1 lib/dm-core/support/inflections.rb
  2. +16 −0 spec/unit/inflections_spec.rb
View
2 lib/dm-core/support/inflections.rb
@@ -41,7 +41,7 @@ module DataMapper
inflect.singular(/(shoe)s$/i, '\1')
inflect.singular(/(cris|ax|test)es$/i, '\1is')
inflect.singular(/(octop|vir)i$/i, '\1us')
- inflect.singular(/(alias|status)es$/i, '\1')
+ inflect.singular(/(alias|status)(es)?$/i, '\1')
inflect.singular(/^(ox)en/i, '\1')
inflect.singular(/(vert|ind)ices$/i, '\1ex')
inflect.singular(/(matr)ices$/i, '\1ix')
View
16 spec/unit/inflections_spec.rb
@@ -0,0 +1,16 @@
+require 'spec_helper'
+require 'dm-core/support/inflector/inflections'
+
+describe DataMapper::Inflector do
+
+ it "should singularize 'status' correctly" do
+ DataMapper::Inflector.singularize('status').should eql 'status'
+ DataMapper::Inflector.singularize('status').should_not eql 'statu'
+ end
+
+ it "should singularize 'alias' correctly" do
+ DataMapper::Inflector.singularize('alias').should eql 'alias'
+ DataMapper::Inflector.singularize('alias').should_not eql 'alia'
+ end
+
+end

0 comments on commit 8510666

Please sign in to comment.
Something went wrong with that request. Please try again.