This project is archived and is in readonly mode.
scaffold problem when using certain words
-
2kan
Takuya Okamoto, looks like you're right, gonna dig a bit more and assign a patch if you're correct.
-
2kan
- Tag set to rails edge, bug, generators, patch
- Assigned user set to Santiago Pastorino
Yes, there is a problem that pluralize of a 'stadia' is 'stadias' (really don't know is it correct in english or not), but we know that stadia is correct plural for stadium (but not very popular I think, isn't it?).
I've attached a patch (some test assigned for 'stadium') where I avoid calling pluralize on already pluralized words and singularize on already singularized for the table_name in the named_base.rb (see patch for more details).
-
Dan Pickett
statia or stadiums are the correct terms according to answers.com and dictionary.com
http://wiki.answers.com/Q/What_is_the_plural_of_the_word_stadium
http://dictionary.reference.com/browse/stadia2kan's approach is solid, but there is a deeper problem with the inflector. To avoid the problem in other places I added more omnipotent handling in the inflections so that "weird_string".pluralize.pluralize maintains the proper plural form.
I also added a test loop for all the double plural test cases
Otherwise
"oxen".pluralize.pluralize => "oxens" "media".pluralize.pluralize => "medias" -
2kan
Dan, yes, that's great. I wasn't sure that I can fix it right in the inflector and not sure that there is no more such problems so I've decided just not to call them twice in generators.
-
2kan
I've tested both patches for 3.0.4 Everything is ok.
-
2kan
This bug is reproduces for 3.0.4 and both patches fixes the issue.
-
2kan
Summary: This patches was done agains master and tested against master. Also I've applied them against 3.0.4 (this issue exists there) and tested (everything is ok). And I've applied them against 3.0-stable (this issue exists there) and tested (everything is ok).
-
Repository
- State changed from new to committed
(from [c6fac7b449ad88a623d99487d2731dddc6555636]) Fixed issue #6363 scaffold problem when using certain words, avoid to pluralized already pluralized names and singularize a single in generators, for example stadia is a valid plural for stadium. But calling pluralize for stadia will return stadias which sematically is not corrent in this case
[#6363 scaffold problem when using certain words state:committed]
Signed-off-by: Santiago Pastorino santiago@wyeworks.com
https://github.com/rails/rails/commit/c6fac7b449ad88a623d99487d2731... -
Repository
(from [1754bd9b208e8d9207c226d1ffb3cee490856a78]) handle double pluralization for irregular plurals
[#6363 scaffold problem when using certain words]
Signed-off-by: Santiago Pastorino santiago@wyeworks.com
https://github.com/rails/rails/commit/1754bd9b208e8d9207c226d1ffb3c... -
Repository
(from [e925acb8269037354269456c5b89260725abf566]) handle double pluralization for irregular plurals
[#6363 scaffold problem when using certain words]
Signed-off-by: Santiago Pastorino santiago@wyeworks.com
https://github.com/rails/rails/commit/e925acb8269037354269456c5b892... -
Repository
(from [149c3d687aba7093c925d8824c610e3639f976bd]) Fixed issue #6363 scaffold problem when using certain words, avoid to pluralized already pluralized names and singularize a single in generators, for example stadia is a valid plural for stadium. But calling pluralize for stadia will return stadias which sematically is not corrent in this case
[#6363 scaffold problem when using certain words state:committed]
Signed-off-by: Santiago Pastorino santiago@wyeworks.com
https://github.com/rails/rails/commit/149c3d687aba7093c925d8824c610...
