From: Amiri Barksdale at Home Date: Wed, 4 May 2011 23:49:56 +0000 (-0700) Subject: Remove commented code, spurious deps. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f49b3ff102d369c2cf79fa25c3ac3845d75e133b;p=dbsrgits%2FDBIx-Class-ResultSource-MultipleTableInheritance.git Remove commented code, spurious deps. --- diff --git a/lib/DBIx/Class/ResultSource/MultipleTableInheritance.pm b/lib/DBIx/Class/ResultSource/MultipleTableInheritance.pm index 3c6b450..ab2a213 100644 --- a/lib/DBIx/Class/ResultSource/MultipleTableInheritance.pm +++ b/lib/DBIx/Class/ResultSource/MultipleTableInheritance.pm @@ -162,20 +162,6 @@ method attach_additional_sources () { ); $table->set_primary_key($self->primary_columns); - ## Attempting to re-add sequence here -- AKB - #for my $pk ( $self->primary_columns ) { - #if ($parent) { - -##use 5.012; use Devel::Dwarn; say Dwarn $schema->source($table->_relationships->{parent}->{class}) if $table->_relationships->{parent}->{class}; - #$table->columns_info->{$pk}->{sequence} = - #$self->set_sequence( - #$schema->source( $table->_relationships->{parent}->{class} )->name, - #$self->primary_columns ) - #if $table->columns_info->{$pk}->{originally_defined_in} ne $self->name - #&& $table->_relationships->{parent}->{class}; - #} - #} - # we need to copy our rels to the raw object as well # note that ->add_relationship on a source object doesn't create an # accessor so we can leave that part in the attributes @@ -309,23 +295,6 @@ BEGIN { $function$ LANGUAGE plpgsql; }; }; - #*function_body = sub ($name,$args,$body_parts) { - #my $arglist = join( - #', ', - #map "_${\$_->{name}} ${\uc($_->{data_type})}", - #@$args - #); - #my $body = join("\n", '', map " $_;", @$body_parts); - #return strip tt q{ - #CREATE OR REPLACE FUNCTION [% name %] - #([% arglist %]) - #RETURNS VOID AS $function$ - #BEGIN - #[%- body %] - #END; - #$function$ LANGUAGE plpgsql; - #}; - #}; } BEGIN { @@ -380,7 +349,7 @@ method view_definition () { my @pk_cols = pk_cols $self; # Grab sequence from root table. Only works with one PK named id... - # TBD: fix this so it's more flexible. + # TBD: Fix this so it's more flexible. for my $pk_col (@pk_cols) { $self->columns_info->{ $pk_col->{name} }->{sequence} = $self->root_table->name . '_id_seq'; @@ -481,7 +450,12 @@ Use multiple tables to define your classes =head1 NOTICE -This only works with PostgreSQL for the moment. +This only works with PostgreSQL at the moment. It has been tested with +PostgreSQL 9.0 and 9.1 beta. + +There is one additional caveat: the "parent" result classes that you +defined with this resultsource must have one primary column and it must +be named "id." =head1 SYNOPSIS diff --git a/t/04no_sequence_defined.t b/t/04no_sequence_defined.t index 4d84dc3..d350359 100644 --- a/t/04no_sequence_defined.t +++ b/t/04no_sequence_defined.t @@ -4,7 +4,6 @@ use lib 't/lib'; use Test::More qw(no_plan); use Test::Exception; use NoSequenceSalad; -use Devel::Dwarn; BEGIN { $ENV{DBIC_TRACE} = 0; @@ -49,7 +48,6 @@ lives_ok { my $sqlt_object = $schema->{sqlt}; -#diag Dwarn $sqlt_object; is_deeply( [ map { $_->name } $sqlt_object->get_views ], [ qw/