Date: | Tue, 23 Sep 2003 20:11:06 +0100 |
From: | Tony Bowden <tony [...] kasei.com> |
To: | Dominic Mitchell <dom [...] semantico.com> |
CC: | bug-Class-Dbi [...] rt.cpan.org |
Subject: | Re: MCPK / has_a deflation |
On Tue, Sep 23, 2003 at 03:13:39PM +0100, Dominic Mitchell wrote:
Show quoted text
> +my $pref = eval { $acc->add_to_prefs( { name => 'foo', value => 'bar' }) };
> +is( $@, '', 'Account->add_to_prefs() not go boom' );
> +isa_ok( $pref, 'AccountPreference', '$pref' );
> +TODO: {
> + local $TODO = 'bug in has_many / add_to_xxx?';
> + isa_ok( $pref->acc_id, 'Account', '$pref->acc_id' );
> +}
This one is indeed different. It's because inflation only really happens
when something is pulled from the database. After a create all the non-PK
columns get cleaned out of the object. So when you next call the method
for them, they get selected, and thus inflated. PK columns don't get
cleaned out (as we've no way of reinstating them), and so don't get
inflated.
I'm not sure how to fetch this, or even whether it's worth fetching...
Tony