[Dbix-class] Re: name collision

Jeremy J. Koch jjkoch at gwi.net
Thu Jul 3 21:29:37 BST 2008


From: Jeremy J. Koch <jjkoch at gwi.net>
Subject: name collision
Date: Thu, 03 Jul 2008 16:21:52 -0400 (EDT)

> I have the luck of a table with a column named "source_name".
> 
> This of course results in a hilarious situation:
> DBIx::Class::Row::get_column(): Can't fetch data as class method at (eval 6724)
> 
> Normally I would take the easy route and rename the column.  Unfortunately 
> the schema is defined by a proprietary application I am integrating with so
> this is not an option.  The only solution I could come up with was to omit
> "source_name" column from the schema class.  Then to use +select with +as
> resultset attributes to specify an a different name for the column. 
> 
> Any thoughts?  Have I overlooked a simpler solution?

Replying to my own message is probably bad form...

I found the answer in the ResultSource documentation.

Sorry for the noise!

-Jeremy




More information about the DBIx-Class mailing list