blue_cowdawg has asked for the wisdom of the Perl Monks concerning the following question:

In the classic example from the Class::DBI documentation where you have a table that has a one to many relationship to another you can invoke a method called  add_to_<tablename>s(...). That's a fine thing.

However, what is the inflection it is using when you have a table whose name ends in "s;"? I've tried all sorts of permutations to no avail. I have a table called "system" that has a one to many relationship with a table called "os" and I keep getting errors when invoking

$system -> add_to_os(...); or $system ->add_to_oss(...); or $system -> add_to_oses(...);


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

Replies are listed 'Best First'.
Re: Class::DBI inflection (plurality)
by VSarkiss (Monsignor) on Jun 21, 2006 at 18:09 UTC
Re: Class::DBI inflection (plurality)
by eric256 (Parson) on Jun 21, 2006 at 17:32 UTC

    The documentation seems to imply that its add_to_ prepended to the name of the relation as specified with Music::CD->has_many(tracks => 'Music::Track'); So maybe you can just name that differently there? I realy don't know thought because CDBI has always been smarter than me ;)


    ___________
    Eric Hodges
Re: Class::DBI inflection (plurality)
by shmem (Chancellor) on Jun 21, 2006 at 17:12 UTC
    Dunno, but maybe you could use the System::Os->insert() idiom ? (just out of the blue ;-) You might also grep the keys of the symbol table for add_to_ ..

    BTW, which errors do you get?

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}