[Bast-commits] r3945 -
DBIx-Class-Partitioned/1.000/trunk/lib/DBIx/Class
edenc at dev.catalyst.perl.org
edenc at dev.catalyst.perl.org
Wed Jan 16 17:43:30 GMT 2008
Author: edenc
Date: 2008-01-16 17:43:30 +0000 (Wed, 16 Jan 2008)
New Revision: 3945
Modified:
DBIx-Class-Partitioned/1.000/trunk/lib/DBIx/Class/Partitioned.pm
Log:
fixed rel propagation
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-16 10:27:08 UTC (rev 3944)
+++ DBIx-Class-Partitioned/1.000/trunk/lib/DBIx/Class/Partitioned.pm 2008-01-16 17:43:30 UTC (rev 3945)
@@ -2,6 +2,7 @@
use warnings;
use strict;
+use Storable ();
use base qw/DBIx::Class/;
=head1 NAME
@@ -51,14 +52,15 @@
my $new_source_name = join '::', map { ucfirst } split '_', $partition;
$new_source->source_name($new_source_name);
$new_source->name($partition);
- foreach my $rel_name ( $source->relationships ) {
- my $rel_info = $source->relationship_info($rel_name);
- $rel_info->{attrs}{cascade_delete} = 0;
- $new_source->add_relationship( $rel_name,
- @{$rel_info}{qw/source cond attrs/} );
- }
+ $new_source->_relationships(
+ Storable::dclone( $new_source->_relationships ) );
+ $new_source->relationship_info($_)->{attrs}{cascade_delete} = 0
+ for $new_source->relationships;
$class->_partitions->{$partition} = $new_source;
}
+
+# $class->ensure_class_loaded('DBIx::Class::ResultSource::Table::Partitioned');
+# $class->table_class();
$class->ensure_class_loaded('DBIx::Class::ResultSet::Partitioned');
$class->resultset_class('DBIx::Class::ResultSet::Partitioned')
unless $class->can('DBIx::Class::ResultSet::Partitioned');
More information about the Bast-commits
mailing list