On 1/3/08 11:14 AM, John Siracusa wrote: >> Because my schema name can change based upon domain and type (and I want >> to keep everything in My::DB), I did the following in my Inventory >> class: >> schema => My::DB->new_or_cached(type => 'custom')->schema, >> >> It works, and seems to be okay - see any problems with that? > > That should be fine, so long as the default domain is set > appropriately before that line of code is run.
It occurs to me that you can also just get the schema from the registry entry itself (rather than creating and then discarding a vestigial db object). It's a bit more verbose, but arguably more clear in its intention: schema => My::DB->registry->entry(domain => My::DB->default_domain, type => 'custom')->schema, -John ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object