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



From n [...] shaplov.ru Fri Apr 13 03: 05:27 2012
MIME-Version: 1.0
X-Spam-Status: No, score=-4.075 tagged_above=-99.9 required=10 tests=[AWL=-2.175, BAYES_00=-1.9] autolearn=ham
X-Spam-Flag: NO
Message-ID: <201204131103.59467.n [...] shaplov.ru>
content-type: Text/Plain; charset="utf-8"
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Organization: TCI
X-Spam-Score: -4.075
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id E349E24025D for <cpan-bug+DBIx-Class [...] hipster.bestpractical.com>; Fri, 13 Apr 2012 03:05:26 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eckHrTIwqdaE for <cpan-bug+DBIx-Class [...] hipster.bestpractical.com>; Fri, 13 Apr 2012 03:05:25 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 37310240032 for <bug-DBIx-Class [...] rt.cpan.org>; Fri, 13 Apr 2012 03:05:24 -0400 (EDT)
Received: (qmail 11614 invoked by uid 103); 13 Apr 2012 07:05:24 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 13 Apr 2012 07:05:24 -0000
Received: from mail.sudo.su (HELO mail.sudo.su) (178.63.209.16) by 16.mx.develooper.com (qpsmtpd/0.80/v0.80-19-gf52d165) with ESMTP; Fri, 13 Apr 2012 00:05:20 -0700
Received: from lenovo.localnet (ppp85-141-107-24.pppoe.mtu-net.ru [85.141.107.24]) by mail.sudo.su (Postfix) with ESMTPSA id C4A06190FB9 for <bug-DBIx-Class [...] rt.cpan.org>; Fri, 13 Apr 2012 07:05:15 +0000 (UTC)
Delivered-To: cpan-bug+DBIx-Class [...] hipster.bestpractical.com
Subject: DBIx::Class::InflateColumn documentation: second arg in inflate/deflate subs exists but not covered by pod
User-Agent: KMail/1.13.7 (Linux/3.1.0-1-686-pae; KDE/4.6.5; i686; ; )
Return-Path: <n [...] shaplov.ru>
X-RT-Mail-Extension: dbix-class
X-Original-To: cpan-bug+DBIx-Class [...] hipster.bestpractical.com
X-Spam-Check-BY: 16.mx.develooper.com
Date: Fri, 13 Apr 2012 11:03:59 +0400
X-Spam-Level:
To: bug-DBIx-Class [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Nikolay Shaplov <n [...] shaplov.ru>
X-RT-Original-Encoding: us-ascii
Content-Length: 927
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
MIME-Version: 1.0
In-Reply-To: <201204131103.59467.n [...] shaplov.ru>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <201204131103.59467.n [...] shaplov.ru>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-18075-1334301373-371.76525-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 279
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!
MIME-Version: 1.0
In-Reply-To: <201204131103.59467.n [...] shaplov.ru>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <201204131103.59467.n [...] shaplov.ru>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-1200-1351959272-135.76525-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 94
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.