[Dbix-class] result_class bug in -current

Guillermo Roditi groditi at gmail.com
Tue May 22 17:58:52 GMT 2007


Fixed in -current

+++ lib/DBIx/Class/ResultSet.pm (revision 12517)
@@ -1618,9 +1618,13 @@
     my $join_count =3D $seen->{$rel};
     my $alias =3D ($join_count > 1 ? join('_', $rel, $join_count) : $rel);

+    #XXX - temp fix for result_class bug. There likely is a more elegant
fix -groditi
+    my %attrs =3D %{$self->{attrs}||{}};
+    delete $attrs{result_class};
+
     $self->_source_handle->schema->resultset($rel_obj->{class})->search_rs(
       undef, {
-        %{$self->{attrs}||{}},
+        %attrs,
         join =3D> undef,
         prefetch =3D> undef,
         select =3D> undef,


On 5/21/07, Guillermo Roditi <groditi at gmail.com> wrote:
>
> seems to fail in trunk as well
>
> On 5/21/07, Christopher H. Laco <claco at chrislaco.com> wrote:
>
> > Guillermo Roditi wrote:
> > > Jess (castaway) ran into a bug today when using result_class and
> > > related_resultset. A failing test has been checked into -current as
> > > 97result_class.t  it beats the hell out of me. I tried to walk through
> > it,
> > > but was unsuccessful. could someone please take a look at this? I'm
> > too
> > > beat
> > > for it today.
> > >
> > >  my $cd_rc =3D $schema->resultset("CD")->result_class;
> > >  my $artist_rs =3D $schema->resultset("Artist")
> > >    ->search_rs({}, {result_class =3D> "IWillExplode"});
> > >  is($artist_rs->result_class, 'IWillExplode', 'Correct artist
> > > result_class');
> > >  my $cd_rs =3D $artist_rs->related_resultset('cds');
> > >  is($cd_rs->result_class, $cd_rc, 'Correct cd result_class');  #this
> > will
> > > fail
> >
> > I'm away from a working perl at the moment...
> > what does the failure do..gripe about "did you remember to load
> > IWIllExplode"?
> >
> > Thanls for hte test though.
> > error_report_plus_test++
> >
> > -=3DChris
> >
> >
> > _______________________________________________
> > List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
> > Wiki: http://dbix-class.shadowcatsystems.co.uk/
> > IRC: irc.perl.org#dbix-class
> > SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
> > Searchable Archive:
> > http://www.mail-archive.com/dbix-class@lists.rawmode.org/
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20070522/bf5=
56bab/attachment-0001.htm


More information about the Dbix-class mailing list