On Tuesday 28 October 2008 03:05:48 Matt S Trout wrote:
> > Module I want to contribute, ModifyColumn, can do it:
> >
> > my @status = qw/ok banned warned something else/;
> > __PACKAGE__->modify_column('status', {
> >     inflate => sub { $status[$_[0]] },
> >     deflate => sub {
> >         my $value = shift;
> >         for (my $i=0; $i<=$#status; $i++) {
> >             return $i if $status[$i] eq $value;
> >         }
> >         return undef;
> >     }
> > });
> >
> > http://lists.scsys.co.uk/pipermail/dbix-class/2008-October/006968.html
>
> Be nice if you could handle >1 value and >1 actual column - the biggest
> annoyance of inflate_column has been the limitation of 1 column and 1
> attribute.

I don't clearly understand what you mean. Can you give an example of desired 
interface?

Now I'm doing like this:
foreach my $c (qw/col1 col2 col3/) {
  __PACKAGE__->modify_column($c, {...});
}


-- 
Kind regards, Eugeny.

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]

Reply via email to