From: Jason M. Mills Date: Tue, 10 Feb 2009 05:30:07 +0000 (+0000) Subject: Merge 'trunk' into 'rt_bug_41083' X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e99ba9d087c435bfc7ad74496d993daffe385c13;p=dbsrgits%2FDBIx-Class-Historic.git Merge 'trunk' into 'rt_bug_41083' Merged trunk in to rt_bug_t41083 branch via svk merge. --- e99ba9d087c435bfc7ad74496d993daffe385c13 diff --cc lib/DBIx/Class/Schema.pm index dc69062,9222f80..1c75a50 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@@ -208,13 -208,9 +208,12 @@@ sub load_namespaces local *Class::C3::reinitialize = sub { }; use warnings 'redefine'; - foreach my $result (keys %results) { + # ensure classes are loaded and fetch properly sorted classes + $class->ensure_class_loaded($_) foreach(values %results); + my @subclass_last = sort { $results{$a}->isa($results{$b}) } keys(%results); + + foreach my $result (@subclass_last) { my $result_class = $results{$result}; - $result_class->source_name($result) unless $result_class->source_name; - $class->ensure_class_loaded($result_class); my $rs_class = delete $resultsets{$result}; my $rs_set = $result_class->resultset_class;