[Dbix-class] seeming error in Manual's CD db example
Peter Rabbitson
rabbit+dbic at rabbit.us
Thu May 13 09:19:24 GMT 2010
Darren Duncan wrote:
> Hello,
>
> If you look at
> http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/Manual/Example.pod
> , I am seeing what appears to be an error in the example, in this block
>
> package MyDatabase::Main::Result::Cd;
> use base qw/DBIx::Class::Core/;
> __PACKAGE__->load_components(qw/InflateColumn::DateTime/);
> __PACKAGE__->table('cd');
> __PACKAGE__->add_columns(qw/ cdid artist title/);
> __PACKAGE__->set_primary_key('cdid');
> __PACKAGE__->belongs_to('artist' => 'MyDatabase::Main::Result::Artist');
> __PACKAGE__->has_many('tracks' => 'MyDatabase::Main::Result::Track');
>
> Maybe I'm misunderstanding something, but offhand it looks like
> "InflateColumn::DateTime" is being loaded gratuitously because the
> database doesn't have any temporal data columns, just plain text and/or
> plain integers, so that component would never be used.
>
> So maybe that line can be removed? And if not then why not?
>
It can be removed, the actual test-schema-CD class has a year column, and
this is possibly where the component seeped from.
More information about the DBIx-Class
mailing list