[Bast-commits] r6860 -
DBIx-Class/0.08/branches/table_name_ref/lib/SQL/Translator/Parser/DBIx
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Mon Jun 29 22:25:28 GMT 2009
Author: ribasushi
Date: 2009-06-29 22:25:27 +0000 (Mon, 29 Jun 2009)
New Revision: 6860
Modified:
DBIx-Class/0.08/branches/table_name_ref/lib/SQL/Translator/Parser/DBIx/Class.pm
Log:
This is sloppy, but sqlt is sloppy too. All tests pass now, all we really need is to intercept name() set-calls, and use a virtual view (the only legit setter is the new() call in ResultSourceProxy::Table
Modified: DBIx-Class/0.08/branches/table_name_ref/lib/SQL/Translator/Parser/DBIx/Class.pm
===================================================================
--- DBIx-Class/0.08/branches/table_name_ref/lib/SQL/Translator/Parser/DBIx/Class.pm 2009-06-29 22:03:21 UTC (rev 6859)
+++ DBIx-Class/0.08/branches/table_name_ref/lib/SQL/Translator/Parser/DBIx/Class.pm 2009-06-29 22:25:27 UTC (rev 6860)
@@ -81,10 +81,8 @@
{
my $source = $dbicschema->source($moniker);
my $table_name = $source->name;
+ $table_name = $$table_name if ref $table_name eq 'SCALAR'; #sqlt currently does not do quoting right anyway
- # Skip custom query sources
- next if ref $table_name;
-
# Its possible to have multiple DBIC sources using the same table
next if $tables{$table_name};
@@ -141,6 +139,7 @@
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
my $reverse_rels = $source->reverse_relationship_info($rel);
my ($otherrelname, $otherrelationship) = each %{$reverse_rels};
@@ -259,6 +258,7 @@
{
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
# Skip custom query sources
next if ref $view_name;
More information about the Bast-commits
mailing list