[CDBI] add_column - bug or feature?

Kate Yoak kate at longmedia.com
Mon Jan 9 09:15:08 GMT 2006


Having just installed a new server, I ran into the following problem.  A
relationship fails to load with the message:

Need a Column, got <column name>.

This message is coming from this method within Class::DBI::ColumnGrouper:

sub add_column {
        my ($self, $col) = @_;

        # TODO remove this
        croak "Need a Column, got $col" unless
$col->isa("Class::DBI::Column");
        $self->{_allcol}->{ $col->name_lc } ||= $col;
}

The verstion of CDBI is 3.0.13

On the other servers I have version 3.0.1
sub add_column {
   my ($self, $name) = @_;
   return $name if ref $name;
   $self->{_allcol}->{ lc $name } ||= Class::DBI::Column->new($name);
}

OK, so this explains why code that used to work quit doing so.  The question
is - what should I be doing?  The code which is causing me to go here is:

$class->__grouper->add_group(TEMP => $accessor);
I swiped this from Relationship::IsA whose code hasn't change as far as I
can tell - and it probably fails too.

The purpose of this statement is to create an accessor which stores the data
indicated by the relationship.

Is there a new paradigm for this expression which I should be switching to?
Or is this an omission given the TODO statement above?

Cheers,
Kate
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digitalcraftsmen.net/mailman/private/classdbi/attachments/20060109/632809bd/attachment.htm


More information about the ClassDBI mailing list