[CDBI] Odd behaviour under RedHat vs Debian

Mike Whitaker mike at mindcandydesign.com
Tue Nov 21 10:37:10 GMT 2006


> Well. I found it. If someone can explain why it works under 3.0.14  
> and fails under 3.0.16, that would be shiny:

...

> I've been overriding accessor names with:
>
> sub accessor_name
> {
>     my ($class, $column) = @_;
>     $column =~ s/_id$//;
>     return $column;
> }
>
> which basically strips trailing '_id' off any accessor name, so  
> that for example $class->player will work just as well as $class- 
> >player_id
>
> Which is all fine and shiny. Except that the table referenced by  
> MCD::SQL::PointAward has a column called table_id...

accessor_name() was, of course, deprecated in 3.0.15. The code that  
goes ahead and calls it anyway, with a warning, doesn't quite behave  
the same as in 3.0.14.
-- 
Mike Whitaker - mike at mindcandydesign.com
Tel: +44 (0) 20 7501 1920 - Mob: +44 (0) 7971 977375
Skype: FleetfootMike; AIM: FleetfootMike





More information about the ClassDBI mailing list