Skip Menu |
 

This queue is for tickets about the Class-DBI CPAN distribution.

Report information
The Basics
Id: 25433
Status: new
Priority: 0/
Queue: Class-DBI

People
Owner: Nobody in particular
Requestors: adamlounds [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Documentation error re:accessor_name_for()
Date: Wed, 14 Mar 2007 16:30:46 +0000
To: bug-Class-DBI [...] rt.cpan.org
From: adam <adamlounds [...] gmail.com>
Download (untitled) / with headers
text/plain 813b
http://search.cpan.org/~tmtm/Class-DBI-v3.0.16/lib/Class/DBI.pm#Changing_Your_Column_Accessor_Method_Names The example code in the pod is sub accessor_name_for { my ($class, $column) = @_; $column =~ s/^customer//; return $column; } But accessor_name_for is passed a DBI::Class::Column object, which stringifies to it name, not its accessor. If you override the column using your own Class::DBI::Column (as documented in the section immediately above this code), it doesn't work - the accessor method isn't created (one is created for $column->name, but not one for $column->accessor) The example code should be something like sub accessor_name_for { my ($class, $column) = @_; my $accessor = $column->accessor; $accessor =~ s/^customer//; return $accessor; } Thanks, -- Adam


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.