Revision history for Perl extension DBIx::Class::Schema::Loader
+ - fix bug with result class methods being cached on in a closure instead
+ of the object, which breaks for multiple dynamic schemas in a single
+ perl instance
+
0.07003 2011-01-21 06:43:05
- fix relname/method collisions (RT#62648)
- fix fully qualified component classes (RT#62624)
rel_collision_map
real_dump_directory
datetime_undef_if_invalid
+ _result_class_methods
/);
=head1 NAME
$self->_inject($table_class, @{$self->additional_base_classes});
}
-{
- my %result_methods;
-
- sub _is_result_class_method {
- my ($self, $name) = @_;
+sub _is_result_class_method {
+ my ($self, $name) = @_;
- %result_methods || do {
- my @methods;
- my $base = $self->result_base_class || 'DBIx::Class::Core';
- my @components = map { /^\+/ ? substr($_,1) : "DBIx::Class::$_" } @{ $self->components || [] };
+ if (not $self->_result_class_methods) {
+ my (@methods, %methods);
+ my $base = $self->result_base_class || 'DBIx::Class::Core';
+ my @components = map { /^\+/ ? substr($_,1) : "DBIx::Class::$_" } @{ $self->components || [] };
- for my $class ($base, @components, $self->use_moose ? 'Moose::Object' : ()) {
- load_class $class;
+ for my $class ($base, @components, $self->use_moose ? 'Moose::Object' : ()) {
+ load_class $class;
- push @methods, @{ Class::Inspector->methods($class) || [] };
- }
+ push @methods, @{ Class::Inspector->methods($class) || [] };
+ }
- push @methods, @{ Class::Inspector->methods('UNIVERSAL') };
+ push @methods, @{ Class::Inspector->methods('UNIVERSAL') };
- @result_methods{@methods} = ();
+ @methods{@methods} = ();
- # futureproof meta
- $result_methods{meta} = undef;
- };
+ # futureproof meta
+ $methods{meta} = undef;
- return exists $result_methods{$name};
+ $self->_result_class_methods(\%methods);
}
+ my $result_methods = $self->_result_class_methods;
+
+ return exists $result_methods->{$name};
}
sub _resolve_col_accessor_collisions {