Ted Zlatanov wrote:
> I couldn't find an example in the docs of how to set up
> Rose::DB::Object::Loader with a properly pluralizing convention manager.
> I tried the following, but I keep getting a class called "Currencie"
> from a table called "currencies" for example. I must be missing
> something.
I'm not sure if this will help, but i had a similar sort of problem with
a table called 'Category'. this is my loader (which works). I can't
remember where this is originally sourced from unfortunately (but i
would suspect the list archives)
this is my DB::Metadata.pm
package EatLocal::DB::Metadata;
use Rose::DB::Object::Metadata;
our @ISA = qw(Rose::DB::Object::Metadata);
use Lingua::EN::Inflect::Number;
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;
}
1;
Adam
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/rose-db-object