minor docs update, use connection not connect after manually cloning from composed_schema
[catagits/Catalyst-Model-DBIC-Schema.git] / lib / Catalyst / Model / DBIC / Schema.pm
index e7d7a83..789a11d 100644 (file)
@@ -1,14 +1,14 @@
 package Catalyst::Model::DBIC::Schema;
 
 use strict;
-use base qw/Catalyst::Base Class::Accessor::Fast Class::Data::Accessor/;
+use base qw/Catalyst::Model Class::Accessor::Fast Class::Data::Accessor/;
 use NEXT;
 use UNIVERSAL::require;
 use Carp;
 
-our $VERSION = '0.01';
+our $VERSION = '0.02';
 
-__PACKAGE__->mk_classdata('composed_schema');
+__PACKAGE__->mk_classaccessor('composed_schema');
 __PACKAGE__->mk_accessors('schema');
 
 =head1 NAME
@@ -55,12 +55,12 @@ Catalyst::Model::DBIC::Schema - DBIx::Class::Schema Model Class
     # or, if your schema works on different storage drivers:
     my $newconn = $c->model('Foo')->composed_schema->clone();
     $newconn->storage_type('::LDAP');
-    $newconn->connect(...);
+    $newconn->connection(...);
 
     # and again, a convenience shortcut
     my $newconn = $c->model('Foo')->clone();
     $newconn->storage_type('::LDAP');
-    $newconn->connect(...);
+    $newconn->connection(...);
 
 =head1 DESCRIPTION
 
@@ -145,8 +145,7 @@ Shortcut for ->schema->resultset
 =cut
 
 sub new {
-    my ( $self, $c ) = @_;
-    $self = $self->NEXT::new($c);
+    my $self = shift->NEXT::new(@_);
     
     my $class = ref($self);
     my $model_name = $class;
@@ -173,7 +172,7 @@ sub new {
     $self->composed_schema($schema_class->compose_namespace($class));
     $self->schema($self->composed_schema->clone);
     $self->schema->storage_type($self->{storage_type}) if $self->{storage_type};
-    $self->schema->connect(@{$self->{connect_info}});
+    $self->schema->connection(@{$self->{connect_info}});
 
     no strict 'refs';
     foreach my $moniker ($self->schema->sources) {