[Dbix-class] Class methods on result source classes

Oleg Pronin syber.rus at gmail.com
Wed Sep 12 14:51:43 GMT 2007


Fixes the bug (with hanging Class::C3::XS in some cases).


--- DBIx-old/Class/ResultSetManager.pm  Fri Jun  1 07:27:35 2007
+++ DBIx/Class/ResultSetManager.pm      Fri Sep  7 09:46:07 2007
@@ -3,6 +3,7 @@
 use warnings;
 use base 'DBIx::Class';
 use Class::Inspector;
+use Sub::Name 'subname';

 =3Dhead1 NAME

@@ -90,7 +91,7 @@
         if ($attrs->[0] eq 'ResultSet') {
             no strict 'refs';
             my $resultset_class =3D $self->_setup_resultset_class;
-            *{"$resultset_class\::$meth"} =3D $self->can($meth);
+            *{"$resultset_class\::$meth"} =3D subname
"$resultset_class\::$meth" =3D> $self->can($meth);
             delete ${"${self}::"}{$meth};
         }
     }

...by vladimir timofeev



2007/9/3, Matt S Trout <dbix-class at trout.me.uk>:
>
> On Mon, Sep 03, 2007 at 08:13:49AM -0700, Evaldas Imbrasas wrote:
> > If you all you need is to be able to write class methods for your
> > model classes, you can use DBIx::Class::ResultSetManager:
> >
> http://search.cpan.org/~ash/DBIx-Class-0.08006/lib/DBIx/Class/ResultSetMa=
nager.pm
>
> Nobody's stepped up to fix the outstanding bugs with it (notably
> subclassing
> not working right) so I expect to deprecate this for 09 and remove it for
> 1.0
> unless somebody makes the effort.
>
> --
>      Matt S Trout       Need help with your Catalyst or DBIx::Class
> project?
>   Technical Director    Want a managed development or deployment platform?
> Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a
> quote
> http://chainsawblues.vox.com/
> http://www.shadowcat.co.uk/
>
> _______________________________________________
> List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive:
> http://www.grokbase.com/group/dbix-class@lists.rawmode.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20070912/0cc=
9e68c/attachment-0001.htm


More information about the DBIx-Class mailing list