From: Peter Rabbitson Date: Sat, 8 Aug 2009 22:34:09 +0000 (+0000) Subject: Fix a corner case and improve comments X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4678e9dae8607c8ca38257c1ddd5d850ebb28dda;p=dbsrgits%2FDBIx-Class-Historic.git Fix a corner case and improve comments --- diff --git a/lib/DBIx/Class/ResultSource.pm b/lib/DBIx/Class/ResultSource.pm index d7f20b4..f3c4b4f 100644 --- a/lib/DBIx/Class/ResultSource.pm +++ b/lib/DBIx/Class/ResultSource.pm @@ -585,7 +585,7 @@ sub name_unique_constraint { my ($self, $cols) = @_; my $name = $self->name; - $name = $$name if ref $name; + $name = $$name if (ref $name eq 'SCALAR'); return join '_', $name, @$cols; } diff --git a/lib/SQL/Translator/Parser/DBIx/Class.pm b/lib/SQL/Translator/Parser/DBIx/Class.pm index de7c948..2ee47d5 100644 --- a/lib/SQL/Translator/Parser/DBIx/Class.pm +++ b/lib/SQL/Translator/Parser/DBIx/Class.pm @@ -82,7 +82,8 @@ sub parse { 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,7 +142,10 @@ 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 + + # 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,7 +278,10 @@ EOW { 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;