Thanks It does the trick but not completly... so maybe i should
conform to rails convention.
What i don"t understand is why if my singular model is "Affilie", my
plural shoud not be "Affilies" ?

I m so confused that i don t even understand what should be the
plural.

Thanks.


On 21 oct, 13:41, Pradeep Gatram <[EMAIL PROTECTED]> wrote:
> I wonder how the rest of your code is working, but you can try the
> following as a work around.
>
> ~$ irb1.8
> irb(main):001:0> require 'rubygems'
> => true
> irb(main):002:0> require 'active_support'
> => true
> irb(main):003:0> 'Affilie'.pluralize
> => "Affilies"
> irb(main):004:0> 'Affilie'.pluralize.singularize
> => "Affily"
> irb(main):007:0> Inflector.inflections { |inflect|
> inflect.irregular('affilie', 'affilies') }
> DEPRECATION WARNING: Inflector is deprecated! Use
> ActiveSupport::Inflector instead.  Seehttp://www.rubyonrails.org/deprecation
> for details. (called from irb_binding at (irb):7)
> => [[/(a)ffilies$/i, "\\1ffilie"], [/k(?i)ine$/, "cow"], [/K(?i)ine$/,
> "Cow"], [/(m)oves$/i, "\\1ove"], [/(s)exes$/i, "\\1ex"], [/(c)hildren$/
> i, "\\1hild"], [/(m)en$/i, "\\1an"], [/(p)eople$/i, "\\1erson"], [/
> (quiz)zes$/i, "\\1"], [/(matr)ices$/i, "\\1ix"], [/(vert|ind)ices$/i,
> "\\1ex"], [/^(ox)en/i, "\\1"], [/(alias|status)es$/i, "\\1"], [/(octop|
> vir)i$/i, "\\1us"], [/(cris|ax|test)es$/i, "\\1is"], [/(shoe)s$/i, "\
> \1"], [/(o)es$/i, "\\1"], [/(bus)es$/i, "\\1"], [/([m|l])ice$/i, "\
> \1ouse"], [/(x|ch|ss|sh)es$/i, "\\1"], [/(m)ovies$/i, "\\1ovie"], [/
> (s)eries$/i, "\\1eries"], [/([^aeiouy]|qu)ies$/i, "\\1y"], [/([lr])ves
> $/i, "\\1f"], [/(tive)s$/i, "\\1"], [/(hive)s$/i, "\\1"], [/([^f])ves$/
> i, "\\1fe"], [/(^analy)ses$/i, "\\1sis"], [/((a)naly|(b)a|(d)iagno|
> (p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i, "\\1\\2sis"], [/([ti])a$/i,
> "\\1um"], [/(n)ews$/i, "\\1ews"], [/s$/i, ""]]
> irb(main):008:0> 'Affilie'.pluralize.singularize
> => "Affilie"
> irb(main):009:0>
>
> The change is caused by  Inflector.inflections { |inflect|
> inflect.irregular('affilie', 'affilies') }. You can add this to config/
> environments/inflections.rb in your rails app.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to