This project is archived and is in readonly mode.
Inflector doesn't pick up inflections
-
Bart Zonneveld
I added 'serie' => 'series' to the Irregularities in inflector_test_cases.rb and got this as test result:
1) Failure:
test_irregularity_between_serie_and_series(InflectorTest)
[./test/inflector_test.rb:189:in `test_irregularity_between_serie_and_series'
./test/../lib/active_support/testing/setup_and_teardown.rb:67:in `__send__'
./test/../lib/active_support/testing/setup_and_teardown.rb:67:in `run']:
<"serie"> expected but was
<"series">.
-
Tarmo Tänav
- State changed from new to invalid
- Tag set to activesupport, bug, edge
Hi, this happens because series is uncountable, meaning that its singular form is the same as its plural:
inflect.uncountable(%w(equipment information rice money species series fish sheep)) -
Bart Zonneveld
Yeah it does, but it's kinda funky that custom inflections are overruled by the default uncountables. This isn't documented, and, imho, unwanted behaviour.
-
Tarmo Tänav
- State changed from invalid to open
Yeah, I guess this could be patched so later rules would override previous ones, I however have no idea how simple or difficult that might be, feel free to investigate.
-
Peter Wagenet
- Tag changed from activesupport, bug, edge to activesupport, bug, edge, patch, tested
This is pretty easy to fix. I've attached a patch with a fix and tests.
-
Repository
- State changed from open to resolved
(from [a652c300ac9d60f6420d1cf86632f6a3c4ceef17]) New inflectors will overwrite defaults [#337 Inflector doesn't pick up inflections state:resolved]
Signed-off-by: Tarmo Tänav tarmo@itech.ee http://github.com/rails/rails/co...
