On Fri, 21 Dec 2007 20:53:55 -0500 John Siracusa <[EMAIL PROTECTED]> wrote:
JS> On 12/21/07 8:39 PM, Adam Prime wrote: >> sub init_convention_manager { >> my $self = shift; >> >> my $cm = $self->SUPER::init_convention_manager(@_); >> >> $cm->singular_to_plural_function(\&Lingua::EN::Inflect::Number::to_PL); >> $cm->plural_to_singular_function(\&Lingua::EN::Inflect::Number::to_S); >> return $cm; >> } JS> Also, FWIW, remember that the arguably better and more straightforward way JS> to do this is to make your own ConventionManager subclass and simply JS> override the singular_to_plural() and plural_to_singular() methods. (Then JS> set the "default" convention_manager_class() name in your Metadata subclass, JS> yada.) JS> The technique shown above (and also used as an example in the docs) is JS> basically just a way to avoid making a subclass if you just want to override JS> the singular/plural methods. But in the long run, making a proper JS> ConventionManager subclass is probably the best bet. For my particular situation, maybe. As a general solution, a proper plural_to_singular function would be the right solution, and would save everyone's time, not just mine. Maybe Rose::DB::Object::Loader could have an interactive mode where it asks you what's the singular/plural of each table name. This could be implemented in the ConventionManager or at the RDBO::Loader level. Ted ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object