OK, this is my last post on the subject. I need to eat, and the wife actually wants to interact with me rather than watch me curse at the computer all morning.
The talk of add_columns and Handel is a side road carnival show. It's a symptom of another problem. I believe that problem is this: compose_namespace clones a schema, then creates new classes. The result of compose_namespace is a schema object in which its sources are new, not the original sources, and the source classes are new, also not the originals. The fault lie inthe fact that the new source classes aren't tied to the new source objects via result_source_instance. Instead, class->result_source_instance is inherited, and still points to the original pre-cloned sources. The following patch fixes the problem for me, and the basic test suite still passes for me. I can't speak for the mysql/pg tests. Someone please try those just for the sake of my sanity. > Index: lib/DBIx/Class/Schema.pm > =================================================================== > --- lib/DBIx/Class/Schema.pm (revision 2145) > +++ lib/DBIx/Class/Schema.pm (working copy) > @@ -390,6 +390,7 @@ > $target_class => $source->result_class, ($base ? $base : ()) > ); > $source->result_class($target_class); > + $target_class->result_source_instance($source); > } > } > Class::C3->reinitialize(); The code actually speaks to my theory I think. The new sources' result_class is associated with the new class, but the reverse wasn't true. I wouldn't dare commit this since the topic is somewhat complicated. :-) -=Chris
signature.asc
Description: OpenPGP digital signature
_______________________________________________ List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class Wiki: http://dbix-class.shadowcatsystems.co.uk/ IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/ Searchable Archive: http://www.mail-archive.com/[email protected]/
