[Bast-commits] r3964 -
DBIx-Class-Partitioned/1.000/trunk/lib/DBIx/Class
matthewt at dev.catalyst.perl.org
matthewt at dev.catalyst.perl.org
Tue Jan 22 04:31:46 GMT 2008
Author: matthewt
Date: 2008-01-22 04:31:46 +0000 (Tue, 22 Jan 2008)
New Revision: 3964
Modified:
DBIx-Class-Partitioned/1.000/trunk/lib/DBIx/Class/Partitioned.pm
Log:
clean up Partitioned code some
Modified: DBIx-Class-Partitioned/1.000/trunk/lib/DBIx/Class/Partitioned.pm
===================================================================
--- DBIx-Class-Partitioned/1.000/trunk/lib/DBIx/Class/Partitioned.pm 2008-01-22 04:06:46 UTC (rev 3963)
+++ DBIx-Class-Partitioned/1.000/trunk/lib/DBIx/Class/Partitioned.pm 2008-01-22 04:31:46 UTC (rev 3964)
@@ -36,7 +36,7 @@
my ($self) = @_;
return unless $self->_current_partition;
my $partition =
- $self->result_source->original_source->partition(
+ $self->result_source->partition(
$self->_current_partition );
return $partition->resultset->find( $self->ident_condition ) ? 1 : 0;
}
@@ -44,8 +44,12 @@
sub insert_partitioned {
my ($self) = @_;
return if !$self->_current_partition or $self->in_partition;
+ $self->result_source(
+ $self->result_source
+ ->original_source
+ );
my $partition =
- $self->result_source->original_source->partition(
+ $self->result_source->partition(
$self->_current_partition );
$partition->storage->insert( $partition, { $self->get_columns } );
}
@@ -71,9 +75,10 @@
my $class = shift;
my $self = $class->next::method(@_);
$self->_current_partition( $self->_partition_name || '' );
- my $original = $self->result_source->original_source;
-# $original->schema( $self->result_source->schema );
- $self->result_source($original);
+ if (my $source = $self->result_source) {
+ my $original = $source->original_source;
+ $self->result_source($original);
+ }
return $self;
}
More information about the Bast-commits
mailing list