From: Jess Robinson Date: Thu, 8 Jun 2006 12:55:46 +0000 (+0000) Subject: Fix insert overloading example X-Git-Tag: v0.07002~80 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ccbebdbc10496de4b8f64687716e737db5314ff0;p=dbsrgits%2FDBIx-Class.git Fix insert overloading example --- diff --git a/lib/DBIx/Class/Manual/Cookbook.pod b/lib/DBIx/Class/Manual/Cookbook.pod index 1cfed1d..f0004b2 100644 --- a/lib/DBIx/Class/Manual/Cookbook.pod +++ b/lib/DBIx/Class/Manual/Cookbook.pod @@ -716,11 +716,11 @@ redispatches your call to store_column to the superclass(es). You might have a class C which has many Cs. Further, you want to create a C object every time you insert an C object. -You can accomplish this by overriding C: +You can accomplish this by overriding C on your objects: sub insert { - my ( $class, $args_ref ) = @_; - my $self = $class->next::method($args_ref); + my ( $self, @args ) = @_; + $self->next::method(@args); $self->cds->new({})->fill_from_artist($self)->insert; return $self; }