[Dbix-class] DBIx::Class:Schema::Loader has_many relationship names

Brandon Black blblack at gmail.com
Fri Feb 24 15:01:29 CET 2006


On 2/24/06, Adam Sjøgren <asjo at koldfront.dk> wrote:
> On Fri, 24 Feb 2006 12:42:02 +0000, Matt wrote:
>
> > That's because the default inflect code doesn't handle plurals - if you
> > want non-default behaviour, pass it an inflect_map option.
>
> (Ok - I was trying to ask what the default behaviour is supposed to be
> :-))
>
> > I can see your reasoning but the vast majority of users (I think) have
> > singular table names rather than plural, so the default config caters to
> > that.
>
> Ok, that makes sense (the default working with what most people do).
>
> Do most people really name their tables in the singular? I find that
> quite confusing.
>
>

I also make my table names plural, although in light of all the
discussions that have popped up from this, I'll probably change that
habit next time around.

When making the has_many name, Loader uses
Lingua::EN::Inflect::pluralize on the table name. 
Lingua::EN::Inflect::pluralize docs say the result is"undefined" when
you pass in an already plural name (but the result tends to really be
that it strips pluralization).

It needs a better solution, I just haven't though of one yet.

-- Brandon



More information about the Dbix-class mailing list