[Dbix-class] Bizarre error: Can't fetch data as class method
Peter Rabbitson
rabbit+dbic at rabbit.us
Tue Jul 7 12:38:42 GMT 2009
On Tue, Jul 07, 2009 at 06:02:02PM +1200, Dan Horne wrote:
> Hi all
>
> This morning I generated my schema using DBIX::Schema::Loader and spent
> the best part of a day trying to debug the following message;
>
> DBIx::Class::Row::get_column(): Can't fetch data as class method at
> (eval 74) line 6
>
> After much faffing around, I managed to zero in on the error. i had the
> following definition in a class:
>
> "source_name",
> {
> data_type => "VARCHAR2",
> default_value => undef,
> is_nullable => 0,
> size => 50,
> },
>
> It seems there must be some collision between the column name and
> something in DBIC. So, how can I progress if I can't change the column
> name in the underlying table?
>
You diagnosed everything correctly, this is an unfortunate clash. Look at
the POD for DBIC::ResultSource::add_columns(), especially the 'accessor'
attribute.
Cheers
More information about the DBIx-Class
mailing list