Skip Menu |
 

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

Report information
The Basics
Id: 76525
Status: resolved
Priority: 0/
Queue: DBIx-Class

People
Owner: Nobody in particular
Requestors: n [...] shaplov.ru
Cc:
AdminCc:

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



Subject: DBIx::Class::InflateColumn documentation: second arg in inflate/deflate subs exists but not covered by pod
Date: Fri, 13 Apr 2012 11:03:59 +0400
To: bug-DBIx-Class [...] rt.cpan.org
From: Nikolay Shaplov <n [...] shaplov.ru>
Download (untitled) / with headers
text/plain 927b
I was writing a schema that should use different inflate/deflate functions for "content" attribute, depending on the value of "type" attr. First I read a documentation and thought it is impossible. Then I've dumped all function arguments and found out that inflate/deflate subs are receiving a Result Record as as a second argument. But this behavior is not covered by documentation. Using the Result Record arg you can do something like this: __PACKAGE__->inflate_column('content' => { deflate => sub {my $content = shift; my $rr = shift; return lc($content) if $rr->type eq 'NS'; ....... return $content; }, }); If this behavior is not going to be changed in further versions (I hope it will not) it is better to be property documented
Download (untitled) / with headers
text/plain 279b
It already is documented: https://metacpan.org/source/ARODLAND/DBIx-Class-0.08196/lib/DBIx/Class/InflateColumn.pm#L64 I would be happy to accept a patch to make the documentation clearer however. Let me know if you plan to submit one, or if we should close this ticket. Cheers!
Documentation and synopsis improved in https://github.com/dbsrgits/dbix-class/commit/c2a04c0b0


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.