[Bast-commits] r7266 - in DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib: DBIx/Class SQL/Translator/Parser/DBIx

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Sat Aug 8 22:34:10 GMT 2009


Author: ribasushi
Date: 2009-08-08 22:34:09 +0000 (Sat, 08 Aug 2009)
New Revision: 7266

Modified:
   DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/ResultSource.pm
   DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/SQL/Translator/Parser/DBIx/Class.pm
Log:
Fix a corner case and improve comments

Modified: DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/ResultSource.pm
===================================================================
--- DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/ResultSource.pm	2009-08-08 22:23:24 UTC (rev 7265)
+++ DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/DBIx/Class/ResultSource.pm	2009-08-08 22:34:09 UTC (rev 7266)
@@ -585,7 +585,7 @@
   my ($self, $cols) = @_;
 
   my $name = $self->name;
-  $name = $$name if ref $name;
+  $name = $$name if (ref $name eq 'SCALAR');
 
   return join '_', $name, @$cols;
 }

Modified: DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/SQL/Translator/Parser/DBIx/Class.pm
===================================================================
--- DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/SQL/Translator/Parser/DBIx/Class.pm	2009-08-08 22:23:24 UTC (rev 7265)
+++ DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/table_name_ref/lib/SQL/Translator/Parser/DBIx/Class.pm	2009-08-08 22:34:09 UTC (rev 7266)
@@ -82,7 +82,8 @@
         my $source = $dbicschema->source($moniker);
         my $table_name = $source->name;
 
-        # sqlt currently does not do quoting right anyway
+        # FIXME - this isn't the right way to do it, but sqlt does not
+        # support quoting properly to be signaled about this
         $table_name = $$table_name if ref $table_name eq 'SCALAR';
 
         # Its possible to have multiple DBIC sources using the same table
@@ -141,8 +142,11 @@
 
             my $othertable = $source->related_source($rel);
             my $rel_table = $othertable->name;
-            $rel_table = $$rel_table if ref $rel_table eq 'SCALAR';  #sqlt currently does not do quoting right anyway
 
+            # FIXME - this isn't the right way to do it, but sqlt does not
+            # support quoting properly to be signaled about this
+            $rel_table = $$rel_table if ref $rel_table eq 'SCALAR';
+
             my $reverse_rels = $source->reverse_relationship_info($rel);
             my ($otherrelname, $otherrelationship) = each %{$reverse_rels};
 
@@ -274,8 +278,11 @@
     {
         my $source = $dbicschema->source($moniker);
         my $view_name = $source->name;
-        $view_name = $$view_name if ref $view_name eq 'SCALAR';  #sqlt currently does not do quoting right anyway
 
+        # FIXME - this isn't the right way to do it, but sqlt does not
+        # support quoting properly to be signaled about this
+        $view_name = $$view_name if ref $view_name eq 'SCALAR';
+
         # Skip custom query sources
         next if ref $view_name;
 




More information about the Bast-commits mailing list