Forum: Ruby on Rails Repost: Pluralization of non-noun names

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
55f28e9c77b35b1539af6be60986b0e4?d=identicon&s=25 Philip Rhoades (Guest)
on 2006-05-20 06:20
(Received via mailing list)
People,

I didn't get an answer to this before so I am trying again:

I could change an existing "policy" table to "policies" with no drama
but the are a number of related tables ie:

p_2quot
p_addr
p_cc
p_cs
p_direct
p_div
p_exss
p_ll
p_mp
p_note
p_prop
p_prov
p_rent
p_rnwl
p_sdiv
p_seq
p_wrkrs
p_xaddr

Each policy may or may not have a corresponding record in one of these
other tables - if it does it could be a one-to-many or a one-to-one
relationship.  Is there a way to create new nouns in RoR so that I could
create the corresponding plurals like:

p_2quots
p_addrs
p_ccs
.
.
etc

and the system would work as normal?

Thanks,

Phil.
--
Philip Rhoades

Pricom Pty Limited  (ACN 003 252 275  ABN 91 003 252 275)
GPO Box 3411
Sydney NSW      2001
Australia
Mobile:  +61:(0)411-185-652
Fax:     +61:(0)2-8221-9599
E-mail:  phil@pricom.com.au
C45e8b0eac09ee52dd88142e99b1094b?d=identicon&s=25 Arunkumar Balu (arun)
on 2006-05-20 06:35
(Received via mailing list)
click the following link, you may get some useful info....
http://nubyonrails.com/tools/pluralize
40db9e75b3f5899258e3bdc0c9210154?d=identicon&s=25 Conrad Taylor (Guest)
on 2006-05-20 06:35
(Received via mailing list)
Hey Philip, pluralization works on english words instead of variables.
 Thus, I would recommend do the following:

1)  just simply rename the offending tables because it seems that some
wouldn't
     produce a valid pluralization to begin with.  However, you maybe
able to create
     a mapping with rails that should prevent you from changing the
actual table names.

If someone on the list knows a solution for this rails user, please
post to the mailist.

Peace,

-Conrad
55f28e9c77b35b1539af6be60986b0e4?d=identicon&s=25 Philip Rhoades (Guest)
on 2006-05-20 06:54
(Received via mailing list)
Arun,

Thanks for that! - the pluralizer seems to work on my non-english nouns!

Regards,

Phil.


On Sat, 2006-05-20 at 10:04 +0530, Arun kumar wrote:
>         I could change an existing "policy" table to "policies" with
>         p_ll
>
>         p_ccs
>         Philip Rhoades
>         _______________________________________________
>         Rails mailing list
>         Rails@lists.rubyonrails.org
>         http://lists.rubyonrails.org/mailman/listinfo/rails
>
--
Philip Rhoades

Pricom Pty Limited  (ACN 003 252 275  ABN 91 003 252 275)
GPO Box 3411
Sydney NSW      2001
Australia
Mobile:  +61:(0)411-185-652
Fax:     +61:(0)2-8221-9599
E-mail:  phil@pricom.com.au
This topic is locked and can not be replied to.