Re: [CDBI] Re: delete on table with multiple pks

[prev] [thread] [next] [Date index for 2005/11/28]

From: Peter Speltz
Subject: Re: [CDBI] Re: delete on table with multiple pks
Date: 16:57 on 28 Nov 2005
On 11/28/05, Perrin Harkins <perrin@xxxx.xxx> wrote:
> On Sun, 2005-11-27 at 23:47 -0600, Peter Speltz wrote:
> > Are you saying inflating key columns works fine in DBIx::Class?
>
> It works fine in Class::DBI with the one line patch I posted in June.  I
> can re-send it later if you need it.
>

Thanks. I think i have it. Is this it ?

diff -r -u orig/Class-DBI-0.96/lib/Class/DBI/Relationship/HasA.pm
Class-DBI-0.96/lib/Class/DBI/Relationship/HasA.pm
--- orig/Class-DBI-0.96/lib/Class/DBI/Relationship/HasA.pm=092004-04-25
11:33:36.000000000 -0400
+++ Class-DBI-0.96/lib/Class/DBI/Relationship/HasA.pm=092005-05-27
14:43:36.000000000 -0400
@@ -23,6 +23,7 @@
 =09my $column =3D $self->accessor;
 =09return (
 =09=09select              =3D> $self->_inflator,
+=09=09after_create        =3D> $self->_inflator,
 =09=09"after_set_$column" =3D> $self->_inflator,
 =09=09deflate_for_create  =3D> $self->_deflator(1),
 =09=09deflate_for_update  =3D> $self->_deflator,
diff -r -u orig/Class-DBI-0.96/t/06-hasa.t Class-DBI-0.96/t/06-hasa.t
--- orig/Class-DBI-0.96/t/06-hasa.t=092003-08-19 12:50:07.000000000 -0400
+++ Class-DBI-0.96/t/06-hasa.t=092005-05-27 14:30:14.000000000 -0400
@@ -3,7 +3,7 @@

 BEGIN {
 =09eval "use DBD::SQLite";
-=09plan $@ ? (skip_all =3D> 'needs DBD::SQLite for testing') : (tests =3D>=
 24);
+=09plan $@ ? (skip_all =3D> 'needs DBD::SQLite for testing') : (tests =3D>=
 25);
 }

 @YA::Film::ISA =3D 'Film';
@@ -164,3 +164,19 @@
 =09isa_ok $foo, "Film", "Object in after_create trigger";
 }

+# test has_a() on primary keys
+package MultiKey;
+use base 'CDBase';
+__PACKAGE__->table('multikey');
+__PACKAGE__->columns('Primary' =3D> qw/ id film /);
+__PACKAGE__->has_a(film =3D> "Film");
+__PACKAGE__->db_Main->do( qq{
+     CREATE TABLE multikey (
+=09     id        INTEGER,
+=09     film      VARCHAR(255)
+     )
+});
+
+package main;
+my $from_scalar =3D MultiKey->create({ id =3D> 7, film =3D> 'Bad Taste' })=
;
+isa_ok($from_scalar->film(), "Film");
Only in Class-DBI-0.96/t: 06-hasa.t~


--
pjs

_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

(message missing)

[CDBI] delete on table with multiple pks
Jim Salladin 06:02 on 25 Nov 2005

[CDBI] Re: delete on table with multiple pks
Jim Salladin 23:09 on 25 Nov 2005

Re: [CDBI] Re: delete on table with multiple pks
Kingsley Kerce 23:18 on 25 Nov 2005

Re: [CDBI] Re: delete on table with multiple pks
William Ross 00:29 on 27 Nov 2005

Re: [CDBI] Re: delete on table with multiple pks
Matt S Trout 02:49 on 27 Nov 2005

Re: [CDBI] Re: delete on table with multiple pks
Peter Speltz 05:47 on 28 Nov 2005

Re: [CDBI] Re: delete on table with multiple pks
Matt S Trout 15:06 on 28 Nov 2005

Re: [CDBI] Re: delete on table with multiple pks
Perrin Harkins 15:33 on 28 Nov 2005

Re: [CDBI] Re: delete on table with multiple pks
Jim Salladin 05:18 on 30 Nov 2005

Re: [CDBI] Re: delete on table with multiple pks
Kingsley Kerce 05:45 on 30 Nov 2005

Re: [CDBI] Re: delete on table with multiple pks
William Ross 08:24 on 30 Nov 2005

Re: [CDBI] Re: delete on table with multiple pks
Jim Salladin 17:12 on 30 Nov 2005

Re: [CDBI] Re: delete on table with multiple pks
Peter Speltz 16:57 on 28 Nov 2005

Re: [CDBI] Re: delete on table with multiple pks
Perrin Harkins 17:18 on 28 Nov 2005

Re: [CDBI] Re: delete on table with multiple pks
Matt S Trout 18:35 on 28 Nov 2005

[CDBI] Re: delete on table with multiple pks
Edward J. Sabol 21:00 on 28 Nov 2005

Re: [CDBI] Re: delete on table with multiple pks
Peter Speltz 22:29 on 28 Nov 2005

Re: [CDBI] Re: delete on table with multiple pks
Perrin Harkins 22:40 on 28 Nov 2005

Generated at 14:52 on 01 Dec 2005 by mariachi v0.52