From: Peter Rabbitson Date: Mon, 29 Jun 2009 22:25:27 +0000 (+0000) Subject: This is sloppy, but sqlt is sloppy too. All tests pass now, all we really need is... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0adbb3b29be0faf1dfc0e535b09c66670ce80182;p=dbsrgits%2FDBIx-Class-Historic.git 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 --- diff --git a/lib/SQL/Translator/Parser/DBIx/Class.pm b/lib/SQL/Translator/Parser/DBIx/Class.pm index 0966562..b8a9637 100644 --- a/lib/SQL/Translator/Parser/DBIx/Class.pm +++ b/lib/SQL/Translator/Parser/DBIx/Class.pm @@ -81,9 +81,7 @@ sub parse { { my $source = $dbicschema->source($moniker); my $table_name = $source->name; - - # Skip custom query sources - next if ref $table_name; + $table_name = $$table_name if ref $table_name eq 'SCALAR'; #sqlt currently does not do quoting right anyway # Its possible to have multiple DBIC sources using the same table next if $tables{$table_name}; @@ -141,6 +139,7 @@ sub parse { 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 @@ sub parse { { 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;