[Bast-commits] r5674 - DBIx-Class/0.08/branches/multi_stuff/lib/DBIx/Class/Relationship

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Mon Mar 2 16:13:06 GMT 2009


Author: ribasushi
Date: 2009-03-02 16:13:06 +0000 (Mon, 02 Mar 2009)
New Revision: 5674

Modified:
   DBIx-Class/0.08/branches/multi_stuff/lib/DBIx/Class/Relationship/ManyToMany.pm
Log:
Switch m2m helper to find_or_create

Modified: DBIx-Class/0.08/branches/multi_stuff/lib/DBIx/Class/Relationship/ManyToMany.pm
===================================================================
--- DBIx-Class/0.08/branches/multi_stuff/lib/DBIx/Class/Relationship/ManyToMany.pm	2009-03-02 16:04:52 UTC (rev 5673)
+++ DBIx-Class/0.08/branches/multi_stuff/lib/DBIx/Class/Relationship/ManyToMany.pm	2009-03-02 16:13:06 UTC (rev 5674)
@@ -80,12 +80,12 @@
       my $obj;
       if (ref $_[0]) {
         if (ref $_[0] eq 'HASH') {
-          $obj = $f_rel_rs->create($_[0]);
+          $obj = $f_rel_rs->find_or_create($_[0]);
         } else {
           $obj = $_[0];
         }
       } else {
-        $obj = $f_rel_rs->create({@_});
+        $obj = $f_rel_rs->find_or_create({@_});
       }
 
       my $link_vals = @_ > 1 && ref $_[$#_] eq 'HASH' ? pop(@_) : {};




More information about the Bast-commits mailing list