From: Dagfinn Ilmari Mannsåker Date: Sun, 13 Apr 2008 00:48:53 +0000 (+0000) Subject: Make ResultSetManager notice externally defined :ResultSet methods X-Git-Tag: 0.04999_05~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2a620a1bb8efc1a09df54fcd785ba91a66ff4684;p=dbsrgits%2FDBIx-Class-Schema-Loader.git Make ResultSetManager notice externally defined :ResultSet methods by calling $class->table($class->table) after loading the external class definition. --- diff --git a/Changes b/Changes index 4e41beb..b2a62ce 100644 --- a/Changes +++ b/Changes @@ -6,6 +6,7 @@ Not yet released - Allow specifying a custom loader_class, overriding the storage_type-based detection - Cosmetic fixes to dumping of externally defined classes + - Make ResultSetManager notice externally defined :ResultSet methods 0.04999_04 Wed Mar 12, 2008 - Add is_auto_increment detecton for DB2 diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm index 7662d66..5b547e4 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -298,6 +298,10 @@ sub _load_external { warn qq/# Loaded external class definition for '$class'\n/ if $self->debug; + # Make sure ResultSetManager picks up any :ResultSet methods from + # the external definition + $class->table($class->table); + # The rest is only relevant when dumping return if !$self->dump_directory; diff --git a/t/lib/dbixcsl_common_tests.pm b/t/lib/dbixcsl_common_tests.pm index f38f693..93b675b 100644 --- a/t/lib/dbixcsl_common_tests.pm +++ b/t/lib/dbixcsl_common_tests.pm @@ -171,11 +171,7 @@ sub run_tests { can_ok( $class1, 'test_additional_base_additional' ) or $skip_taba = 1; can_ok( $class1, 'dbix_class_testcomponent' ) or $skip_tcomp = 1; can_ok( $class1, 'loader_test1_classmeth' ) or $skip_cmeth = 1; - - TODO: { - local $TODO = "Not yet supported by ResultSetManger code"; - can_ok( $rsobj1, 'loader_test1_rsmeth' ) or $skip_rsmeth = 1; - } + can_ok( $rsobj1, 'loader_test1_rsmeth' ) or $skip_rsmeth = 1; SKIP: { skip "Pre-requisite test failed", 1 if $skip_tab;