On 4/3/07 5:31 AM, Ovid wrote:
> One problem is that the return value of add_columns() is actually the new
> number of columns in the 'columns_ordered' attribute, not the columns
> themselves

Doh!  Fixed in SVN.

> To be fair, I'm going to have to alter even this.  I've realized that
> I'm making my public accessors too tied to the database column names.
> What I really need to do is this:
> 
>   sub add_columns {
>     my $self = shift;
> 
>     $self->SUPER::add_columns(@_);
>     foreach my $column ( $self->columns ) {
>       $self->alias_column(
>         $column->name => $self->class->public_column_name($column)
>       );
>     }
>     return scalar $self->columns;
>   }

Keep in mind that you cannot alias columns that are part of the primary key.
The SVN version should throw an exception if you try, but the CPAN version
will not, so be careful.

-John



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to