From: John Joyce Date: 2007-08-02T03:43:53+09:00 Subject: Re: Railless ActiveRecord On Aug 1, 2007, at 9:47 AM, Ari Brown wrote: > > On Aug 1, 2007, at 8:04 AM, John Joyce wrote: > >> Yes. >> given tables, say: >> categories >> stories >> >> If a category has_many :stories >> then table stories should have a column named category_id >> >> Generally, this association is followed with story >> belongs_to :category for a one to many relationship. >> There are also one to one relationships using has_one and belongs_to >> >> Active Record (and Rails in general from that) uses a very clever >> system of English pluralization for table names and associations >> rely on singular/plural rules. > > Thanks! What do I do if I have: > > has_many :platypi? > > Just kidding, > Thanks, > Ari > --------------------------------------------| > If you're not living on the edge, > then you're just wasting space. > > > Ari, You will be surprised how often the inflector is right about plurals / singulars, but given the number of oddballs in English, it's often better to just choose something that pluralizes easily rather than writing inflection rules. If you wanted to use another language, say japanese which does actually have plural forms that are rarely used or needed, you could define your pluralization rules to end in the appropriate ending.