Yesterday, I opened a GitHub Issue<https://github.com/rails/rails/pull/7071> about moving Rails inflections to an initializer. The idea wasn''t received well, understandably, as generating a large initializer with new Rails apps is pretty unappealing. However, the core members seemed open to the discussion of alternatives continuing here. For those of you not in the know, inflections (the defined rules for singularization/pluralization) in Rails are currently frozen. What this means is that most pull requests submitted that add, remove, or change inflections are closed and not merged. The reasoning behind this is to avoid breaking existing applications that depend on these inflections, even if they are errant. People are advised to fix (yes, fix) these inflections themselves in their inflections initializer. In my opinion, with a major 4.0 release coming up, inflections should be unfrozen and fixed/cleaned up. There is a lot that is bad in this file, and I don''t think fear of breaking existing apps is a good reason to freeze mistakes. People should read the CHANGELOG when updating. They should read the upgrade guides. It''s not that hard to redefine the inflection you need in that initializer, and the current inflections are based mostly around exceptions to grammatical rules rather than the rules themselves. If people want specifics, I''ve written a post about this: http://davidcelis.com/blog/2012/07/18/the-current-state-of-rails-inflections/ I''m curious as to what others think. I''d like to help make this a better framework, and I''ve heard a lot of complaints from personal colleagues about how messy the inflections are. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/zG5cLvQmmUkJ. For more options, visit https://groups.google.com/groups/opt_out.
I personally don''t like them at all. I wish that all the names of controllers/routes/models were unchanged so I wouldn''t have to keep deciding whether I needed to pluralize. I remember spending too much time trying to straighten out a scaffold I created named "series". It created a model named "Serie"! I shouldn''t have to spend energy figuring that out. It should use the exact name I give it. On Wed, Jul 18, 2012 at 8:41 PM, davidcelis <david-8+ab0rdVlAuDvotElmWtJA@public.gmane.org> wrote:> Yesterday, I opened a GitHub Issue about moving Rails inflections to an > initializer. The idea wasn''t received well, understandably, as generating a > large initializer with new Rails apps is pretty unappealing. However, the > core members seemed open to the discussion of alternatives continuing here. > > For those of you not in the know, inflections (the defined rules for > singularization/pluralization) in Rails are currently frozen. What this > means is that most pull requests submitted that add, remove, or change > inflections are closed and not merged. The reasoning behind this is to avoid > breaking existing applications that depend on these inflections, even if > they are errant. People are advised to fix (yes, fix) these inflections > themselves in their inflections initializer. > > In my opinion, with a major 4.0 release coming up, inflections should be > unfrozen and fixed/cleaned up. There is a lot that is bad in this file, and > I don''t think fear of breaking existing apps is a good reason to freeze > mistakes. People should read the CHANGELOG when updating. They should read > the upgrade guides. It''s not that hard to redefine the inflection you need > in that initializer, and the current inflections are based mostly around > exceptions to grammatical rules rather than the rules themselves. > > If people want specifics, I''ve written a post about this: > > http://davidcelis.com/blog/2012/07/18/the-current-state-of-rails-inflections/ > > I''m curious as to what others think. I''d like to help make this a better > framework, and I''ve heard a lot of complaints from personal colleagues about > how messy the inflections are. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
I disagree with this; I think the inflections are important. They''re just messy right now. I don''t think it''s an arduous task to fix them, and I don''t think it''s unreasonable to take the stance of "Rails can''t possibly include every inflection by default." My problem with the current inflections is that it seems like they *were* trying to include every inflection. Now we''ve got a long list of inflections based on exceptions and irregularities, most of which rarely see the light of day in any Rails application. But they''re frozen, so it''s difficult to get Rails core to accept fixes. Looking over grammatical rules, the actual list of inflections could be extremely short: https://gist.github.com/3145080 I could be missing something here, but those cover the regular plurals and a couple of irregularities that will show up in Rails apps enough to warrant definition. More irregularities *could* be argued, but personally I think the stance should be that most irregularities should be defined in the user''s initializer (which is what Rails core tells people now anyways). But telling people right in the documentation to *fix errant inflections* in their initializer? Yes, let''s admit we''re wrong. That''s noble. But let''s fix it, too. On Thursday, July 19, 2012 4:53:43 AM UTC-7, paulie wrote:> > I personally don''t like them at all. I wish that all the names of > controllers/routes/models were unchanged so I wouldn''t have to keep > deciding whether I needed to pluralize. I remember spending too much > time trying to straighten out a scaffold I created named "series". It > created a model named "Serie"! I shouldn''t have to spend energy > figuring that out. It should use the exact name I give it. > > On Wed, Jul 18, 2012 at 8:41 PM, davidcelis <david-8+ab0rdVlAuDvotElmWtJA@public.gmane.org> wrote: > > Yesterday, I opened a GitHub Issue about moving Rails inflections to an > > initializer. The idea wasn''t received well, understandably, as > generating a > > large initializer with new Rails apps is pretty unappealing. However, > the > > core members seemed open to the discussion of alternatives continuing > here. > > > > For those of you not in the know, inflections (the defined rules for > > singularization/pluralization) in Rails are currently frozen. What this > > means is that most pull requests submitted that add, remove, or change > > inflections are closed and not merged. The reasoning behind this is to > avoid > > breaking existing applications that depend on these inflections, even if > > they are errant. People are advised to fix (yes, fix) these inflections > > themselves in their inflections initializer. > > > > In my opinion, with a major 4.0 release coming up, inflections should be > > unfrozen and fixed/cleaned up. There is a lot that is bad in this file, > and > > I don''t think fear of breaking existing apps is a good reason to freeze > > mistakes. People should read the CHANGELOG when updating. They should > read > > the upgrade guides. It''s not that hard to redefine the inflection you > need > > in that initializer, and the current inflections are based mostly around > > exceptions to grammatical rules rather than the rules themselves. > > > > If people want specifics, I''ve written a post about this: > > > > > http://davidcelis.com/blog/2012/07/18/the-current-state-of-rails-inflections/ > > > > I''m curious as to what others think. I''d like to help make this a better > > framework, and I''ve heard a lot of complaints from personal colleagues > about > > how messy the inflections are. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/MHVUP-Uyz2kJ. For more options, visit https://groups.google.com/groups/opt_out.
For anybody who shares my sentiment, until Rails core decides it''s time to clean up their inflections, I''ve published a gem to provide more sane default pluralization/singularization rules: https://github.com/davidcelis/infletions Here''s the difference: 4 pluralization rules (down from 21) 5 singularization rules (down from 27) 3 irregularities (down from 7) 1 uncountable (down from 10) Ahhh. Much better. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/xjJfqfuVAskJ. For more options, visit https://groups.google.com/groups/opt_out.
On Thursday, July 19, 2012 11:22:40 AM UTC-7, davidcelis wrote:> > For anybody who shares my sentiment, until Rails core decides it''s time to > clean up their inflections, I''ve published a gem to provide more sane > default pluralization/singularization rules: > https://github.com/davidcelis/inflections > > Here''s the difference: > > 4 pluralization rules (down from 21) > 5 singularization rules (down from 27) > 3 irregularities (down from 7) > 1 uncountable (down from 10) > > Ahhh. Much better. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/VSkWPNq5E68J. For more options, visit https://groups.google.com/groups/opt_out.
At least they should fix the ones that are incorrect... "Octopus".pluralize should return "Octopuses" and NOT "Octopi"... :) Den torsdagen den 19:e juli 2012 kl. 20:23:15 UTC+2 skrev davidcelis:> > > > On Thursday, July 19, 2012 11:22:40 AM UTC-7, davidcelis wrote: >> >> For anybody who shares my sentiment, until Rails core decides it''s time >> to clean up their inflections, I''ve published a gem to provide more sane >> default pluralization/singularization rules: >> https://github.com/davidcelis/inflections >> >> Here''s the difference: >> >> 4 pluralization rules (down from 21) >> 5 singularization rules (down from 27) >> 3 irregularities (down from 7) >> 1 uncountable (down from 10) >> >> Ahhh. Much better. >> >>-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/rNreNAZ8nB4J. For more options, visit https://groups.google.com/groups/opt_out.
On 19 July 2012 20:07, Linus Pettersson <linus.pettersson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> At least they should fix the ones that are incorrect... > > "Octopus".pluralize should return "Octopuses" and NOT "Octopi"... :)But then all those applications that rely on the current pluralisation of octopus would break when upgraded. Innumerable applications around the internet would come to their knees. Colin> > > > Den torsdagen den 19:e juli 2012 kl. 20:23:15 UTC+2 skrev davidcelis: >> >> >> >> On Thursday, July 19, 2012 11:22:40 AM UTC-7, davidcelis wrote: >>> >>> For anybody who shares my sentiment, until Rails core decides it''s time >>> to clean up their inflections, I''ve published a gem to provide more sane >>> default pluralization/singularization rules: >>> https://github.com/davidcelis/inflections >>> >>> Here''s the difference: >>> >>> 4 pluralization rules (down from 21) >>> 5 singularization rules (down from 27) >>> 3 irregularities (down from 7) >>> 1 uncountable (down from 10) >>> >>> Ahhh. Much better. >>> > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-talk/-/rNreNAZ8nB4J. > > For more options, visit https://groups.google.com/groups/opt_out. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
So many applications! But in seriousness, this IS a terrible argument, is it not? I''m not crazy, am I? There are CHANGELOGs and upgrade guides for a reason. On Thursday, July 19, 2012 12:48:23 PM UTC-7, Colin Law wrote:> > On 19 July 2012 20:07, Linus Pettersson <linus.pettersson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > At least they should fix the ones that are incorrect... > > > > "Octopus".pluralize should return "Octopuses" and NOT "Octopi"... :) > > But then all those applications that rely on the current pluralisation > of octopus would break when upgraded. Innumerable applications around > the internet would come to their knees. > > Colin > > > > > > > > > Den torsdagen den 19:e juli 2012 kl. 20:23:15 UTC+2 skrev davidcelis: > >> > >> > >> > >> On Thursday, July 19, 2012 11:22:40 AM UTC-7, davidcelis wrote: > >>> > >>> For anybody who shares my sentiment, until Rails core decides it''s > time > >>> to clean up their inflections, I''ve published a gem to provide more > sane > >>> default pluralization/singularization rules: > >>> https://github.com/davidcelis/inflections > >>> > >>> Here''s the difference: > >>> > >>> 4 pluralization rules (down from 21) > >>> 5 singularization rules (down from 27) > >>> 3 irregularities (down from 7) > >>> 1 uncountable (down from 10) > >>> > >>> Ahhh. Much better. > >>> > > -- > > You received this message because you are subscribed to the Google > Groups > > "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit > > https://groups.google.com/d/msg/rubyonrails-talk/-/rNreNAZ8nB4J. > > > > For more options, visit https://groups.google.com/groups/opt_out. > > > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/Md24mjiTFHUJ. For more options, visit https://groups.google.com/groups/opt_out.
On 19 July 2012 20:48, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 19 July 2012 20:07, Linus Pettersson <linus.pettersson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> At least they should fix the ones that are incorrect... >> >> "Octopus".pluralize should return "Octopuses" and NOT "Octopi"... :) > > But then all those applications that rely on the current pluralisation > of octopus would break when upgraded. Innumerable applications around > the internet would come to their knees.:-) Surely all those sites'' developers could just override the inflector back to what it used to be, and get on with all the other tasks they need to complete to upgrade to Rails4? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On Thursday, July 19, 2012 6:53:43 AM UTC-5, paulie wrote:> > I personally don''t like them at all. I wish that all the names of > controllers/routes/models were unchanged so I wouldn''t have to keep > deciding whether I needed to pluralize. I remember spending too much > time trying to straighten out a scaffold I created named "series". It > created a model named "Serie"! I shouldn''t have to spend energy > figuring that out. It should use the exact name I give it.I agree with this some what. There have been times where I needed a singular table name or plural model name. I know I could override which table it points to and do a little foot work on my part. The current state of inflections isn''t too horrible, but it should at least be decoupled from Rails core. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/WSlzCT-lKSkJ. For more options, visit https://groups.google.com/groups/opt_out.
Yep, the point I''ve been getting at. People shouldn''t blindly upgrade their Rails versions anyway, and when they see errors that a Controller can''t be found based on their Model name or vice versa, it should be pretty obvious as to what''s going on unless they''re clueless about the inflector. On Thursday, July 19, 2012 1:01:29 PM UTC-7, pavling wrote:> > On 19 July 2012 20:48, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > On 19 July 2012 20:07, Linus Pettersson <linus.pettersson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > >> At least they should fix the ones that are incorrect... > >> > >> "Octopus".pluralize should return "Octopuses" and NOT "Octopi"... :) > > > > But then all those applications that rely on the current pluralisation > > of octopus would break when upgraded. Innumerable applications around > > the internet would come to their knees. > > :-) > > Surely all those sites'' developers could just override the inflector > back to what it used to be, and get on with all the other tasks they > need to complete to upgrade to Rails4? >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/mkakMOYN9goJ. For more options, visit https://groups.google.com/groups/opt_out.
Any thoughts on this from core members, perhaps? On Friday, July 20, 2012 10:25:20 AM UTC-7, davidcelis wrote:> > Yep, the point I''ve been getting at. People shouldn''t blindly upgrade > their Rails versions anyway, and when they see errors that a Controller > can''t be found based on their Model name or vice versa, it should be pretty > obvious as to what''s going on unless they''re clueless about the inflector. > > On Thursday, July 19, 2012 1:01:29 PM UTC-7, pavling wrote: >> >> On 19 July 2012 20:48, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> > On 19 July 2012 20:07, Linus Pettersson <linus.pettersson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> wrote: >> >> At least they should fix the ones that are incorrect... >> >> >> >> "Octopus".pluralize should return "Octopuses" and NOT "Octopi"... :) >> > >> > But then all those applications that rely on the current pluralisation >> > of octopus would break when upgraded. Innumerable applications around >> > the internet would come to their knees. >> >> :-) >> >> Surely all those sites'' developers could just override the inflector >> back to what it used to be, and get on with all the other tasks they >> need to complete to upgrade to Rails4? >> >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/CbGz6IpxEsEJ. For more options, visit https://groups.google.com/groups/opt_out.
One thing that have always bothered me about the inflector and this pluralize business is that it only work in English. That make rails newbies from non-english speaking countries have a harder time learning the technology than they should. I know ruby''s keywords are already in English, and so are method names and so on. But reading a foreing language is easier; and so is using already defined names. However, a person who doesn''t know English very well will not do a good job in naming his own variables and models in English. A famous quote from computer science field goes: "There are only two hard things in Computer Science: cache invalidation and naming things". Imagine naming it in a language you aren''t proficient. Perhaps inflection should not be the default. Maybe it should be optional. If you want it, then you can load your language''s inflection gem, if it''s available. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/o5UvgWOKiLwJ. For more options, visit https://groups.google.com/groups/opt_out.
I don''t think that''s really a good option. Some Rails internals already rely heavily upon the inflections; there have to be some pluralizations loaded by default (whether from within the framework, or an inflections gem). If they WERE to be extracted into a gem (which is what I did), it would still need to be bundled by default. Inflections are used in routing, mapping between models and controllers, and a lot of other places within Rails. They need to be there. On Thursday, July 26, 2012 6:21:26 PM UTC-7, Rafael C. de Almeida wrote:> > One thing that have always bothered me about the inflector and this > pluralize business is that it only work in English. That make rails newbies > from non-english speaking countries have a harder time learning the > technology than they should. I know ruby''s keywords are already in English, > and so are method names and so on. But reading a foreing language is > easier; and so is using already defined names. However, a person who > doesn''t know English very well will not do a good job in naming his own > variables and models in English. A famous quote from computer science field > goes: "There are only two hard things in Computer Science: cache > invalidation and naming things". Imagine naming it in a language you > aren''t proficient. > > Perhaps inflection should not be the default. Maybe it should be optional. > If you want it, then you can load your language''s inflection gem, if it''s > available. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/oTbeZCFCoBYJ. For more options, visit https://groups.google.com/groups/opt_out.
Maybe I''m missing something, but couldn''t the default inflection just don''t do anything? That is, the plural of any word is the word itself. From the user point of view, it would be like there is no pluralization at all. Cheers On Friday, July 27, 2012 12:00:59 PM UTC-3, davidcelis wrote:> > I don''t think that''s really a good option. Some Rails internals already > rely heavily upon the inflections; there have to be some pluralizations > loaded by default (whether from within the framework, or an inflections > gem). If they WERE to be extracted into a gem (which is what I did), it > would still need to be bundled by default. Inflections are used in routing, > mapping between models and controllers, and a lot of other places within > Rails. They need to be there. > > On Thursday, July 26, 2012 6:21:26 PM UTC-7, Rafael C. de Almeida wrote: >> >> One thing that have always bothered me about the inflector and this >> pluralize business is that it only work in English. That make rails newbies >> from non-english speaking countries have a harder time learning the >> technology than they should. I know ruby''s keywords are already in English, >> and so are method names and so on. But reading a foreing language is >> easier; and so is using already defined names. However, a person who >> doesn''t know English very well will not do a good job in naming his own >> variables and models in English. A famous quote from computer science field >> goes: "There are only two hard things in Computer Science: cache >> invalidation and naming things". Imagine naming it in a language you >> aren''t proficient. >> >> Perhaps inflection should not be the default. Maybe it should be >> optional. If you want it, then you can load your language''s inflection gem, >> if it''s available. >> >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/zbAh3C5sOD0J. For more options, visit https://groups.google.com/groups/opt_out.
Rails itself depends on pluralization for the reasons I stated in my last message. On Friday, July 27, 2012 10:03:54 PM UTC-7, Rafael C. de Almeida wrote:> > Maybe I''m missing something, but couldn''t the default inflection just > don''t do anything? That is, the plural of any word is the word itself. From > the user point of view, it would be like there is no pluralization at all. > > Cheers > > On Friday, July 27, 2012 12:00:59 PM UTC-3, davidcelis wrote: >> >> I don''t think that''s really a good option. Some Rails internals already >> rely heavily upon the inflections; there have to be some pluralizations >> loaded by default (whether from within the framework, or an inflections >> gem). If they WERE to be extracted into a gem (which is what I did), it >> would still need to be bundled by default. Inflections are used in routing, >> mapping between models and controllers, and a lot of other places within >> Rails. They need to be there. >> >> On Thursday, July 26, 2012 6:21:26 PM UTC-7, Rafael C. de Almeida wrote: >>> >>> One thing that have always bothered me about the inflector and this >>> pluralize business is that it only work in English. That make rails newbies >>> from non-english speaking countries have a harder time learning the >>> technology than they should. I know ruby''s keywords are already in English, >>> and so are method names and so on. But reading a foreing language is >>> easier; and so is using already defined names. However, a person who >>> doesn''t know English very well will not do a good job in naming his own >>> variables and models in English. A famous quote from computer science field >>> goes: "There are only two hard things in Computer Science: cache >>> invalidation and naming things". Imagine naming it in a language you >>> aren''t proficient. >>> >>> Perhaps inflection should not be the default. Maybe it should be >>> optional. If you want it, then you can load your language''s inflection gem, >>> if it''s available. >>> >>-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/WTQyy8fiZHkJ. For more options, visit https://groups.google.com/groups/opt_out.
I just ran into this again. I attempted to call a model "Media", and the scaffold decided that I meant "Medium", which is NOT a newspaper; it''s someone who has a seance. As I often do in that situation, I deleted those files and changed the name to "MediaOutlet" so it would act predictably. Here''s what would be nice to happen: model: Media controller: media_controller route: /media, media_path, media_new_path, etc... params: params[''media''][''etc''] That beats having to call pluralize and singularize all the time and try to keep it straight. This is especially important for constructing stuff in javascript because the easiest thing is to just assume it is normal and add an ''s''. On Sat, Jul 28, 2012 at 3:01 AM, davidcelis <david-8+ab0rdVlAuDvotElmWtJA@public.gmane.org> wrote:> Rails itself depends on pluralization for the reasons I stated in my last > message. > > > On Friday, July 27, 2012 10:03:54 PM UTC-7, Rafael C. de Almeida wrote: >> >> Maybe I''m missing something, but couldn''t the default inflection just >> don''t do anything? That is, the plural of any word is the word itself. From >> the user point of view, it would be like there is no pluralization at all. >> >> Cheers >> >> On Friday, July 27, 2012 12:00:59 PM UTC-3, davidcelis wrote: >>> >>> I don''t think that''s really a good option. Some Rails internals already >>> rely heavily upon the inflections; there have to be some pluralizations >>> loaded by default (whether from within the framework, or an inflections >>> gem). If they WERE to be extracted into a gem (which is what I did), it >>> would still need to be bundled by default. Inflections are used in routing, >>> mapping between models and controllers, and a lot of other places within >>> Rails. They need to be there. >>> >>> On Thursday, July 26, 2012 6:21:26 PM UTC-7, Rafael C. de Almeida wrote: >>>> >>>> One thing that have always bothered me about the inflector and this >>>> pluralize business is that it only work in English. That make rails newbies >>>> from non-english speaking countries have a harder time learning the >>>> technology than they should. I know ruby''s keywords are already in English, >>>> and so are method names and so on. But reading a foreing language is easier; >>>> and so is using already defined names. However, a person who doesn''t know >>>> English very well will not do a good job in naming his own variables and >>>> models in English. A famous quote from computer science field goes: "There >>>> are only two hard things in Computer Science: cache invalidation and >>>> naming things". Imagine naming it in a language you aren''t proficient. >>>> >>>> Perhaps inflection should not be the default. Maybe it should be >>>> optional. If you want it, then you can load your language''s inflection gem, >>>> if it''s available. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-talk/-/WTQyy8fiZHkJ. > > For more options, visit https://groups.google.com/groups/opt_out. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
On Saturday, 28 July 2012 10:21:23 UTC-4, paulie wrote:> > I just ran into this again. I attempted to call a model "Media", and > the scaffold decided that I meant "Medium", which is NOT a newspaper; > it''s someone who has a seance.Not to be a jerk, but you''re wrong: http://en.wiktionary.org/wiki/media#Etymology_2> As I often do in that situation, I > deleted those files and changed the name to "MediaOutlet" so it would > act predictably. >And as a side effect, got a model name that makes it *way* easier to understand what you''re actually representing. Until you clarified it, my first guess was going to be that ''Media'' was a class representing an audio/video/image file. Here''s what would be nice to happen:> > model: Media > controller: media_controller > route: /media, media_path, media_new_path, etc... > params: params[''media''][''etc''] > > That beats having to call pluralize and singularize all the time and > try to keep it straight.For bonus points, how would the new behavior distinguish between the ''show'' and ''index'' actions? (currently plural-with-no-args vs. singular-with-one-arg) I suspect you''re going to face a lot of pushback from all the developers who *have* managed to "keep it straight", since your suggestion involves breaking every one of their applications. --Matt Jones -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/WCrUkOE6r3kJ. For more options, visit https://groups.google.com/groups/opt_out.
Agreed on all counts. I don''t think pluralization needs to go anywhere. I think the resourceful routes and controller names are more representative of what''s going on. I just think the pluralization rules need to be cleaner and that the backwards compatibility excuse doesn''t work so well for a major 4.0 release. On Sunday, July 29, 2012 9:32:01 AM UTC-7, Matt Jones wrote:> > > > On Saturday, 28 July 2012 10:21:23 UTC-4, paulie wrote: >> >> I just ran into this again. I attempted to call a model "Media", and >> the scaffold decided that I meant "Medium", which is NOT a newspaper; >> it''s someone who has a seance. > > > Not to be a jerk, but you''re wrong: > > http://en.wiktionary.org/wiki/media#Etymology_2 > > > >> As I often do in that situation, I >> deleted those files and changed the name to "MediaOutlet" so it would >> act predictably. >> > > And as a side effect, got a model name that makes it *way* easier to > understand what you''re actually representing. Until you clarified it, my > first guess was going to be that ''Media'' was a class representing an > audio/video/image file. > > Here''s what would be nice to happen: >> >> model: Media >> controller: media_controller >> route: /media, media_path, media_new_path, etc... >> params: params[''media''][''etc''] >> >> That beats having to call pluralize and singularize all the time and >> try to keep it straight. > > > For bonus points, how would the new behavior distinguish between the > ''show'' and ''index'' actions? (currently plural-with-no-args vs. > singular-with-one-arg) > > I suspect you''re going to face a lot of pushback from all the developers > who *have* managed to "keep it straight", since your suggestion involves > breaking every one of their applications. > > --Matt Jones >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/XC_0SxGGFjEJ. For more options, visit https://groups.google.com/groups/opt_out.
index: GET /media show: GET /media/1 edit: GET /media/1/edit create: POST /media update: PUT /media/1 new: GET /media/new delete: DELETE /media I wasn''t suggesting changing this retroactively, I was supporting the idea of the inflections gem, which would allow an replacement that didn''t require duplicating all the rules in javascript. On Sun, Jul 29, 2012 at 12:32 PM, Matt Jones <al2o3cr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > For bonus points, how would the new behavior distinguish between the ''show'' > and ''index'' actions? (currently plural-with-no-args vs. > singular-with-one-arg) > > I suspect you''re going to face a lot of pushback from all the developers who > *have* managed to "keep it straight", since your suggestion involves > breaking every one of their applications. > > --Matt Jones-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Guys, lets keep in mind that I meant for this discussion to be about how the inflection rules themselves are bad. Not how they''re used internally with Rails, but how the file that defines these rules is an utter mess. On Thursday, August 2, 2012 8:30:33 AM UTC-7, paulie wrote:> > index: GET /media > show: GET /media/1 > edit: GET /media/1/edit > create: POST /media > update: PUT /media/1 > new: GET /media/new > delete: DELETE /media > > I wasn''t suggesting changing this retroactively, I was supporting the > idea of the inflections gem, which would allow an replacement that > didn''t require duplicating all the rules in javascript. > > On Sun, Jul 29, 2012 at 12:32 PM, Matt Jones <al2o3cr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > For bonus points, how would the new behavior distinguish between the > ''show'' > > and ''index'' actions? (currently plural-with-no-args vs. > > singular-with-one-arg) > > > > I suspect you''re going to face a lot of pushback from all the developers > who > > *have* managed to "keep it straight", since your suggestion involves > > breaking every one of their applications. > > > > --Matt Jones >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/DxZAM_qvm1cJ. For more options, visit https://groups.google.com/groups/opt_out.