[Bast-commits] r8989 - DBIx-Class/0.08/branches/extended_rels/lib/DBIx/Class/Relationship

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Fri Mar 12 00:22:19 GMT 2010


Author: ribasushi
Date: 2010-03-12 00:22:19 +0000 (Fri, 12 Mar 2010)
New Revision: 8989

Modified:
   DBIx-Class/0.08/branches/extended_rels/lib/DBIx/Class/Relationship/ManyToMany.pm
Log:
Fix object check

Modified: DBIx-Class/0.08/branches/extended_rels/lib/DBIx/Class/Relationship/ManyToMany.pm
===================================================================
--- DBIx-Class/0.08/branches/extended_rels/lib/DBIx/Class/Relationship/ManyToMany.pm	2010-03-11 21:17:02 UTC (rev 8988)
+++ DBIx-Class/0.08/branches/extended_rels/lib/DBIx/Class/Relationship/ManyToMany.pm	2010-03-12 00:22:19 UTC (rev 8989)
@@ -6,6 +6,7 @@
 
 use Carp::Clan qw/^DBIx::Class/;
 use Sub::Name ();
+use Scalar::Util ();
 
 our %_pod_inherit_config = 
   (
@@ -125,10 +126,9 @@
 
     my $remove_meth_name = join '::', $class, $remove_meth;
     *$remove_meth_name = Sub::Name::subname $remove_meth_name, sub {
-      my $self = shift;
-      @_ > 0 && ref $_[0] ne 'HASH'
+      my ($self, $obj) = @_;
+      Scalar::Util::blessed ($obj)
         or $self->throw_exception("${remove_meth} needs an object");
-      my $obj = shift;
       my $rel_source = $self->search_related($rel)->result_source;
       my $cond = $rel_source->relationship_info($f_rel)->{cond};
       my $link_cond = $rel_source->_resolve_condition(




More information about the Bast-commits mailing list