[Dbix-class] DBIC and inflators

Peter Rabbitson rabbit+dbic at rabbit.us
Thu Aug 26 08:33:11 GMT 2010


Pavel A. Karoukin wrote:
> Hello,
> 
> I am trying to make something work nice, but it doesn't want to =)
> Probably, it's just by design, or I am missing something.
> 
> Question: is it possible to make it work with $user->data->{test} = 1;
> notation? I.e. I do not want to create new methods in results class, not
> want to extract hash from field first and then save it?

Absolutely impossible, since the whole idea of InflateColumn is:
*) A plain scalar value supplied to new/update is assumed to be an
already-deflated value to be placed directly in the database
*) Any type of reference (blessed or not) is a candidate for deflation
and passed on to the deflator

However you may find that FilterColumn does exactly what you want to
do.

Cheers



More information about the DBIx-Class mailing list