[Dbix-class] register_source() regression in 0.08102

Matt S Trout dbix-class at trout.me.uk
Mon May 11 17:29:49 GMT 2009


On Thu, May 07, 2009 at 05:45:49PM -0400, Ronald J Kimball wrote:
> I'm currently using the following code in one of my schema modules, 
> based on the message 
> http://www.mail-archive.com/dbix-class@lists.scsys.co.uk/msg02613.html
> 
>   my $new_month = '200905';
>   my $user_session_source = __PACKAGE__->source('UserSession');
>   my $new_source = $user_session_source->new($user_session_source);
>   $new_source->name("user_session_$new_month");
>   __PACKAGE__->register_source("UserSession$new_month" => $new_source);
> 
> This works fine in 0.08010, but in 0.08102, I get the following warning:
> 
> DBIx::Class::Schema::register_source(): 
> AdEngine::Schema::AdEngineDB::UserSession already has a source, use 
> register_extra_source for additional sources at 
> /usr/local/lib/site_perl/AdEngine/Schema/AdEngineDB.pm line 27
> 
> What is the correct way to implement this with 0.08102?  I'm skeptical 
> about register_extra_source(), because I'm not registering an additional 
> source for UserSession; I'm registering a new source for UserSession200905.

register_extra_source is correct - the warning here is so that UserSession
reliably remains the default source for reverse lookups by class.

This is -not- a regression, it's DBIC learning to point out bugs in your code
before they fuck over production :)

-- 
        Matt S Trout         Catalyst and DBIx::Class consultancy with a clue
     Technical Director      and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.uk        http://shadowcat.co.uk/blog/matt-s-trout/



More information about the DBIx-Class mailing list