storage fix for fork() and workaround for Apache::DBI
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / UUIDColumns.pm
index d45eac8..efbe3d4 100644 (file)
@@ -1,5 +1,5 @@
 package DBIx::Class::UUIDColumns;
-use base qw/Class::Data::Inheritable/;
+use base qw/DBIx::Class/;
 
 use Data::UUID;
 
@@ -13,20 +13,18 @@ DBIx::Class::UUIDColumns - Implicit uuid columns
 
   pacakge Artist;
   __PACKAGE__->load_components(qw/UUIDColumns Core DB/);
-  __PACKAGE__->uuid_columns( 'artist_id' );x
+  __PACKAGE__->uuid_columns( 'artist_id' );
 
 =head1 DESCRIPTION
 
-This L<DBIx::Class> component resambles the behaviour of
+This L<DBIx::Class> component resembles the behaviour of
 L<Class::DBI::UUID>, to make some columns implicitly created as uuid.
 
 Note that the component needs to be loaded before Core.
 
 =head1 METHODS
 
-=over 4
-
-=item uuid_columns
+=head2 uuid_columns
 
 =cut
 
@@ -34,26 +32,24 @@ Note that the component needs to be loaded before Core.
 sub uuid_columns {
     my $self = shift;
     for (@_) {
-       die "column $_ doesn't exist" unless exists $self->_columns->{$_};
+       $self->throw_exception("column $_ doesn't exist") unless $self->has_column($_);
     }
     $self->uuid_auto_columns(\@_);
 }
 
 sub insert {
-    my ($self) = @_;
+    my $self = shift;
     for my $column (@{$self->uuid_auto_columns}) {
-       $self->$column( $self->get_uuid )
-           unless defined $self->$column;
+       $self->store_column( $column, $self->get_uuid )
+           unless defined $self->get_column( $column );
     }
-    $self->NEXT::ACTUAL::insert;
+    $self->next::method(@_);
 }
 
 sub get_uuid {
     return Data::UUID->new->to_string(Data::UUID->new->create),
 }
 
-=back
-
 =head1 AUTHORS
 
 Chia-liang Kao <clkao@clkao.org>