[Catalyst-commits] r7684 - in Catalyst-Model-Jifty-DBI/1.0/trunk: . lib lib/Catalyst lib/Catalyst/Helper lib/Catalyst/Helper/Model lib/Catalyst/Helper/Model/Jifty lib/Catalyst/Model lib/Catalyst/Model/Jifty t t/TestApp t/TestApp/lib t/TestApp/lib/TestApp t/TestApp/lib/TestApp/Controller t/TestApp/lib/TestApp/Model t/TestApp/lib/TestApp/Plugin t/TestApp/lib/TestApp/Schema t/TestReference t/TestReference/lib t/TestReference/lib/TestReference t/TestReference/lib/TestReference/Model t/TestReference/lib/TestReference/Schema

charsbar at dev.catalyst.perl.org charsbar at dev.catalyst.perl.org
Tue May 6 15:15:22 BST 2008


Author: charsbar
Date: 2008-05-06 15:15:22 +0100 (Tue, 06 May 2008)
New Revision: 7684

Added:
   Catalyst-Model-Jifty-DBI/1.0/trunk/Changes
   Catalyst-Model-Jifty-DBI/1.0/trunk/MANIFEST
   Catalyst-Model-Jifty-DBI/1.0/trunk/Makefile.PL
   Catalyst-Model-Jifty-DBI/1.0/trunk/README
   Catalyst-Model-Jifty-DBI/1.0/trunk/lib/
   Catalyst-Model-Jifty-DBI/1.0/trunk/lib/Catalyst/
   Catalyst-Model-Jifty-DBI/1.0/trunk/lib/Catalyst/Helper/
   Catalyst-Model-Jifty-DBI/1.0/trunk/lib/Catalyst/Helper/Model/
   Catalyst-Model-Jifty-DBI/1.0/trunk/lib/Catalyst/Helper/Model/Jifty/
   Catalyst-Model-Jifty-DBI/1.0/trunk/lib/Catalyst/Helper/Model/Jifty/DBI.pm
   Catalyst-Model-Jifty-DBI/1.0/trunk/lib/Catalyst/Model/
   Catalyst-Model-Jifty-DBI/1.0/trunk/lib/Catalyst/Model/Jifty/
   Catalyst-Model-Jifty-DBI/1.0/trunk/lib/Catalyst/Model/Jifty/DBI.pm
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/00_load.t
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/10_testapp.t
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/20_trace.t
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/30_references.t
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/99_pod.t
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/99_podcoverage.t
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/Makefile.PL
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp.pm
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Controller/
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Controller/Multi.pm
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Controller/Single.pm
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Model/
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Model/JDBI.pm
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Model/JDBI_M.pm
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Plugin/
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Plugin/ErrorMessage.pm
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Schema/
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Schema/Author.pm
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Schema/Book.pm
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Schema/BookCollection.pm
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/View/
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestReference/
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestReference/lib/
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestReference/lib/TestReference/
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestReference/lib/TestReference/Model/
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestReference/lib/TestReference/Model/JDBI.pm
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestReference/lib/TestReference/Schema/
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestReference/lib/TestReference/Schema/Author.pm
   Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestReference/lib/TestReference/Schema/Book.pm
Log:
imported Catalyst-Model-Jifty-DBI 0.05


Added: Catalyst-Model-Jifty-DBI/1.0/trunk/Changes
===================================================================
--- Catalyst-Model-Jifty-DBI/1.0/trunk/Changes	                        (rev 0)
+++ Catalyst-Model-Jifty-DBI/1.0/trunk/Changes	2008-05-06 14:15:22 UTC (rev 7684)
@@ -0,0 +1,33 @@
+Revision history for Catalyst-Model-Jifty-DBI
+
+0.05 2008/03/22
+  - prepare implicit Collections before loading any Records
+    so as not for JDBI to fail to create relationships
+
+0.04 2008/03/21
+  - bumped up the version requirement of Test::UseAllModules to 0.09
+  - added ->trace method
+
+0.03 2007/11/27
+  - *** INCOMPATIBLE API CHANGE ***
+  - By the request of Matt S. Trout, ISHIGAKI took over this
+    namespace and replaced the origianl Catalyst-Model-Jifty-DBI
+    (written by Marcus Ramberg; 0.01 released on 2006-06-26) 
+    with the former Catalyst-Model-JDBI-Schemas to avoid future
+    confusion. Note that this version has backward incompatibility.
+
+  - added default_handle_name to cache the name internally.
+  - schema_base is a model name you create by default.
+
+Revision history for Catalyst-Model-JDBI-Schemas
+
+0.02 2007/11/27
+  - added missing Test::UseAllModules dependency; no code changes
+
+0.01 2007/11/26
+  - initial release
+
+Revision history for original Catalyst-Model-Jifty-DBI (by Marcus Ramberg)
+
+0.01 2006-06-26 14:21:00
+    - Initial release
\ No newline at end of file


Property changes on: Catalyst-Model-Jifty-DBI/1.0/trunk/Changes
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Catalyst-Model-Jifty-DBI/1.0/trunk/MANIFEST
===================================================================
--- Catalyst-Model-Jifty-DBI/1.0/trunk/MANIFEST	                        (rev 0)
+++ Catalyst-Model-Jifty-DBI/1.0/trunk/MANIFEST	2008-05-06 14:15:22 UTC (rev 7684)
@@ -0,0 +1,25 @@
+Changes
+lib/Catalyst/Helper/Model/Jifty/DBI.pm
+lib/Catalyst/Model/Jifty/DBI.pm
+Makefile.PL
+MANIFEST			This list of files
+README
+t/00_load.t
+t/10_testapp.t
+t/20_trace.t
+t/30_references.t
+t/99_pod.t
+t/99_podcoverage.t
+t/TestApp/lib/TestApp.pm
+t/TestApp/lib/TestApp/Controller/Multi.pm
+t/TestApp/lib/TestApp/Controller/Single.pm
+t/TestApp/lib/TestApp/Model/JDBI.pm
+t/TestApp/lib/TestApp/Model/JDBI_M.pm
+t/TestApp/lib/TestApp/Plugin/ErrorMessage.pm
+t/TestApp/lib/TestApp/Schema/Author.pm
+t/TestApp/lib/TestApp/Schema/Book.pm
+t/TestApp/lib/TestApp/Schema/BookCollection.pm
+t/TestApp/Makefile.PL
+t/TestReference/lib/TestReference/Model/JDBI.pm
+t/TestReference/lib/TestReference/Schema/Author.pm
+t/TestReference/lib/TestReference/Schema/Book.pm


Property changes on: Catalyst-Model-Jifty-DBI/1.0/trunk/MANIFEST
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Catalyst-Model-Jifty-DBI/1.0/trunk/Makefile.PL
===================================================================
--- Catalyst-Model-Jifty-DBI/1.0/trunk/Makefile.PL	                        (rev 0)
+++ Catalyst-Model-Jifty-DBI/1.0/trunk/Makefile.PL	2008-05-06 14:15:22 UTC (rev 7684)
@@ -0,0 +1,25 @@
+use strict;
+use warnings;
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+    NAME          => 'Catalyst::Model::Jifty::DBI',
+    AUTHOR        => 'Kenichi Ishigaki <ishigaki at cpan.org>',
+    VERSION_FROM  => 'lib/Catalyst/Model/Jifty/DBI.pm',
+    ABSTRACT_FROM => 'lib/Catalyst/Model/Jifty/DBI.pm',
+    PREREQ_PM => {
+        'Catalyst::Runtime'     => 0,
+        'Class::Accessor::Fast' => 0,
+        'File::Spec'            => 0,
+        'File::Basename'        => 0,
+        'Jifty::DBI'            => 0.47,
+        'Module::Find'          => 0,
+        'NEXT'                  => 0,
+        'Test::UseAllModules'   => 0.09,
+        'UNIVERSAL::require'    => 0.11,
+    },
+    ($ExtUtils::MakeMaker::VERSION >= 6.31
+        ? ( LICENSE => 'perl' )
+        : ()
+    ),
+);


Property changes on: Catalyst-Model-Jifty-DBI/1.0/trunk/Makefile.PL
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Catalyst-Model-Jifty-DBI/1.0/trunk/README
===================================================================
--- Catalyst-Model-Jifty-DBI/1.0/trunk/README	                        (rev 0)
+++ Catalyst-Model-Jifty-DBI/1.0/trunk/README	2008-05-06 14:15:22 UTC (rev 7684)
@@ -0,0 +1,17 @@
+Catalyst-Model-Jifty-DBI
+
+INSTALLATION
+
+To install this module, run the following commands:
+
+    perl Makefile.PL
+    make
+    make test
+    make install
+
+COPYRIGHT AND LICENSE
+
+Copyright (C) 2007 Kenichi Ishigaki
+
+This program is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.


Property changes on: Catalyst-Model-Jifty-DBI/1.0/trunk/README
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Catalyst-Model-Jifty-DBI/1.0/trunk/lib/Catalyst/Helper/Model/Jifty/DBI.pm
===================================================================
--- Catalyst-Model-Jifty-DBI/1.0/trunk/lib/Catalyst/Helper/Model/Jifty/DBI.pm	                        (rev 0)
+++ Catalyst-Model-Jifty-DBI/1.0/trunk/lib/Catalyst/Helper/Model/Jifty/DBI.pm	2008-05-06 14:15:22 UTC (rev 7684)
@@ -0,0 +1,244 @@
+package Catalyst::Helper::Model::Jifty::DBI;
+
+use strict;
+use warnings;
+use Carp;
+use FindBin;
+use File::Spec;
+use File::Basename;
+
+=head1 NAME
+
+Catalyst::Helper::Model::Jifty::DBI
+
+=head1 SYNOPSIS
+
+  # to create a Catalyst::Model::Jifty::DBI class
+  script/app_create.pl model ModelName Jifty::DBI
+
+  # or, if you really want to hard-code your configuration
+  script/app_create.pl model ModelName Jifty::DBI Schema::Base database test.db ...
+
+  # to create a JDBI::Record/Collection classes under the Model
+  script/create.pl model ModelName::RecordName Jifty::DBI
+
+=head1 BACKWARD INCOMPATIBILITY
+
+Current version of Catalyst::(Helper::)Model::Jifty::DBI was once called Catalyst::(Helper::)Model::JDBI::Schemas, which then replaced the original version written by Marcus Ramberg, by the request of Matt S. Trout (Catalyst Core team) to avoid future confusion. I wonder if anyone used the previous one, but note that APIs have been revamped and backward incompatible since 0.03.
+
+=head1 DESCRIPTION
+
+This helper helps you to create a C::M::Jifty::DBI Model class, and optionally, Jifty::DBI::Record/Collection classes under the Model.
+
+Model class will be created when you run it for the first time. Specify your CatalystApp::Model::Name's basename ("Name" for this case), then, this helper's name (Jifty::DBI).
+
+If you really want to specify schema_base for the model (which is equal to the Model class by default), append that Schema::Base::Name, and the key/value pairs of connect_info hash, too. However, I recommend to use ConfigLoader to avoid hard-coded configuration.
+
+When you set up a Model class, you can create Record/Collection classes. Specify ModelName::RecordName (or Schema::Base::Name), and helper's name. Note that Collection class is created automatically. You don't need to (actually, you shouldn't) specify Collection class name, which is confusing.
+
+=head1 METHODS
+
+=head2 mk_compclass
+
+creates actual Model/Record/Collection classes.
+
+=cut
+
+sub mk_compclass {
+  my $self   = shift;
+  my $helper = shift;
+
+  my $class = $helper->{class};
+  my ($parent) = $class =~ /^(.+)::\w+$/;
+
+  my $parent_pm = dirname( $parent ).'.pm';
+
+  if ( -f $parent_pm && $parent !~ /::M(?:odel)$/i ) {
+    # probably this is a subclass, ie. record/collection class
+
+    my $record_file = $helper->{file};
+
+    croak "Probably you are going to create a Record class, ".
+          "but your Record class has 'Collection' in the name. ".
+          "It's confusing. Please use other name."
+          if $record_file =~ /Collection\.pm$/i;
+
+    $helper->render_file( 'recordclass', $record_file );
+
+    my $collection_file = $record_file;
+       $collection_file =~ s/\.pm$/Collection.pm/;
+
+    $helper->render_file( 'collectionclass', $collection_file );
+  }
+  else {
+    # this should be the main model class
+
+    $helper->{schema_base} = shift || $helper->{class};
+
+    my %connect_info = ( @_ && ( @_ % 2 ) == 0 ) ? @_ : ();
+
+    $connect_info{database} ||= lc $helper->{prefix}.'.db';
+    $connect_info{driver}   ||= 'SQLite';
+    $connect_info{host}     ||= 'localhost';
+
+    $helper->{connect_info} = \%connect_info;
+
+    $helper->render_file( 'schemaclass', $helper->{file} );
+  }
+}
+
+=head1 AUTHOR
+
+Kenichi Ishigaki, E<lt>ishigaki at cpan.orgE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2007 by Kenichi Ishigaki.
+
+This program is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
+
+=cut
+
+1;
+
+__DATA__
+
+=begin pod_to_ignore
+
+__schemaclass__
+package [% class %]
+
+use strict;
+use warnings;
+use base 'Catalyst::Model::Jifty::DBI';
+
+#### You can hard-code your configuration here,
+#### but you may want to use ConfigLoader
+#### to move configuration into config.yaml.
+#
+#__PACKAGE__->config({
+#    schema_base  => [% schema_base %],
+#    connect_info => {
+#        database => '[% connect_info.database %]',
+#        driver   => '[% connect_info.driver %]',
+#        host     => '[% connect_info.host %]',
+#        user     => '[% connect_info.user %]',
+#        password => '[% connect_info.password %]',
+#    },
+#
+#### You may want to use this instead of above connect_info
+#### when you want to use multiple databases.
+#
+#    databases => [
+#        {
+#            name => '[% connect_info.database %]',
+#            connect_info => {
+#                database => '[% connect_info.database %]',
+#                driver   => '[% connect_info.driver %]',
+#                host     => '[% connect_info.host %]',
+#                user     => '[% connect_info.user %]',
+#                password => '[% connect_info.password %]',
+#        },
+#    ],
+#});
+
+=head1 NAME
+
+[% class %] - Catalyst Jifty::DBI Model
+
+=head1 SYNOPSIS
+
+See L<[% app %]>
+
+=head1 DESCRIPTION
+
+L<Catalyst::Model::Jifty::DBI> Model using schemas under L<[% schema_base %]>.
+
+=head1 AUTHOR
+
+[% author %]
+
+=head1 LICENSE
+
+This program is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
+
+=cut
+
+1;
+__recordclass__
+package [% class %];
+
+use strict;
+use warnings;
+use Jifty::DBI::Schema;
+use Jifty::DBI::Record schema {
+
+# write your schema here like this:
+#
+#   column "user_id" => type is "integer", is mandatory;
+#   column "text"    => type is "text";
+#
+# See Jifty/Jifty::DBI's documents/sources/tests for details.
+#
+# Note that you don't have to provide primary key,
+# which would be created by Jifty::DBI automatically.
+
+};
+
+=head1 NAME
+
+[% class %] - Catalyst JDBI Schema/Record
+
+=head1 SYNOPSIS
+
+See L<[% app %]>
+
+=head1 DESCRIPTION
+
+A Record/Schema class for L<Catalyst::Model::Jifty::DBI> Model.
+
+=head1 AUTHOR
+
+[% author %]
+
+=head1 LICENSE
+
+This program is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
+
+=cut
+
+1;
+__collectionclass__
+package [% class %]Collection;
+
+use strict;
+use warnings;
+use base 'Jifty::DBI::Collection';
+
+=head1 NAME
+
+[% class %]Collection - Catalyst JDBI Collection
+
+=head1 SYNOPSIS
+
+See L<[% app %]>
+
+=head1 DESCRIPTION
+
+A Collection class for L<Catalyst::Model::Jifty::DBI> Model.
+
+=head1 AUTHOR
+
+[% author %]
+
+=head1 LICENSE
+
+This program is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
+
+=cut
+
+1;


Property changes on: Catalyst-Model-Jifty-DBI/1.0/trunk/lib/Catalyst/Helper/Model/Jifty/DBI.pm
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Catalyst-Model-Jifty-DBI/1.0/trunk/lib/Catalyst/Model/Jifty/DBI.pm
===================================================================
--- Catalyst-Model-Jifty-DBI/1.0/trunk/lib/Catalyst/Model/Jifty/DBI.pm	                        (rev 0)
+++ Catalyst-Model-Jifty-DBI/1.0/trunk/lib/Catalyst/Model/Jifty/DBI.pm	2008-05-06 14:15:22 UTC (rev 7684)
@@ -0,0 +1,533 @@
+package Catalyst::Model::Jifty::DBI;
+
+use strict;
+use warnings;
+use Carp;
+use base qw( Catalyst::Model Class::Accessor::Fast );
+
+our $VERSION = '0.05';
+
+use NEXT;
+use UNIVERSAL::require;
+use Jifty::DBI::Handle;
+use Module::Find;
+
+__PACKAGE__->mk_accessors(qw( handles connect_infos schema_base ));
+
+sub new {
+  my $self = shift->NEXT::new(@_);
+
+  my $class = ref $self;
+  my $model_name = $class;
+     $model_name =~ s/^[\w:]+::(?:Model|M):://;
+
+  $self->schema_base($class) unless $self->schema_base;
+  $self->connect_infos({});
+  $self->handles({});
+
+  # let's see connect_info; we may have several.
+  if ( ref $self->{connect_info} eq 'HASH' ) {
+    $self->connect_infos->{_} = $self->{connect_info};
+
+    # if we have only one connect_info, then why don't we connect?
+    my $handle = Jifty::DBI::Handle->new;
+       $handle->connect( %{ $self->{connect_info} } );
+
+    $self->handles->{_} = $handle;
+  }
+  elsif ( ref $self->{databases} eq 'ARRAY' ) {
+    foreach my $database ( @{ $self->{databases} } ) {
+      croak "connect_info should be a hash reference"
+        unless ref $database->{connect_info} eq 'HASH';
+
+      my $name = $database->{name}
+              || $database->{connect_info}->{database};
+
+      croak "database should have a unique name"
+        if !$name || $self->connect_infos->{$name};
+
+      $self->connect_infos->{$name} = $database->{connect_info};
+    }
+    # as we may have multiple connect_info, we should just prepare
+    # and wait until we really need to connect.
+  }
+
+  no strict 'refs';
+  my $schema_base = $self->schema_base;
+
+  # prepare implicit collections before loading any records.
+  # so as not for JDBI to fail to create relationships.
+  my %collections;
+  my @monikers = findsubmod $schema_base;
+  foreach my $moniker ( @monikers ) {
+    if ( $moniker =~ /Collection$/ ) {
+      $collections{$moniker} = 1;
+    }
+    else {
+      $collections{$moniker.'Collection'} = 0;
+    }
+  }
+  foreach my $moniker ( keys %collections ) {
+    next if $collections{$moniker};
+    # perhaps you're too lazy to create Collection class.
+    # now we should try creating default one!
+    my $package_body = <<"EOT";
+package $moniker;
+use strict;
+use base qw( Jifty::DBI::Collection );
+1;
+EOT
+      eval $package_body;
+      croak "Can't prepare $moniker: $@" if $@;
+  }
+
+  foreach my $moniker ( @monikers ) {
+    $moniker->require or croak $@;
+    next if $moniker =~ /Collection$/;
+
+    $moniker =~ s/^$schema_base\:://;
+    *{"${class}::${moniker}::ACCEPT_CONTEXT"} = sub {
+      shift;
+      shift->model( $model_name )->record( $moniker );
+    };
+
+    my $collection_moniker = $moniker.'Collection';
+    *{"${class}::${collection_moniker}::ACCEPT_CONTEXT"} = sub {
+      shift;
+      shift->model( $model_name )->collection( $collection_moniker );
+    };
+  }
+  return $self;
+}
+
+sub _select_name {
+  my ($self, %options) = @_;
+
+  return $options{name} if $options{name};
+  return $options{from} if $options{from};
+  return $self->default_handle_name;
+}
+
+sub default_handle_name {
+  my $self = shift;
+
+  if ( @_ ) {
+    my $new_handle = shift;
+    unless ( $self->connect_infos->{$new_handle} ) {
+      croak "$new_handle doesn't have connect_info";
+    }
+    $self->{default_handle} = $new_handle;
+  }
+  unless ( $self->{default_handle} ) {
+    $self->{default_handle} = ( $self->databases )[0];
+  }
+  $self->{default_handle};
+}
+
+sub handle {
+  my ($self, %options) = @_;
+
+  my $name   = $self->_select_name(%options);
+  my $handle = $self->handles->{$name};
+
+  unless ( $handle and $handle->dbh and $handle->dbh->{Active} ) {
+    my $connect_info = $self->connect_infos->{$name};
+    croak "database $name doesn't have connect_info"
+      unless ref $connect_info eq 'HASH';
+
+    $handle = Jifty::DBI::Handle->new;
+    $handle->connect( %$connect_info );
+    $self->handles->{$name} = $handle;
+  }
+  $handle;
+}
+
+sub disconnect {
+  my ($self, %options) = @_;
+
+  my $name   = $self->_select_name(%options);
+  my $handle = $self->handles->{$name};
+
+  if ( $handle and $handle->dbh ) {
+    $handle->disconnect if $handle->dbh->{Active};
+  }
+  else {
+    carp "database $name doesn't exist or open";
+  }
+}
+
+sub database {
+  my ($self, %options) = @_;
+
+  my $name = $self->_select_name(%options);
+
+  if ( $self->connect_infos->{$name} ) {
+    return $self->connect_infos->{$name}->{database};
+  }
+  else {
+    croak "database $name doesn't exist";
+  }
+}
+
+sub databases {
+  my $self = shift;
+  return sort keys %{ $self->connect_infos };
+}
+
+sub setup_database {
+  my $self = shift;
+
+  my $handle = $self->handle( @_ );
+
+  require Jifty::DBI::SchemaGenerator;
+  my $generator = Jifty::DBI::SchemaGenerator->new( $handle );
+
+  foreach my $schema ( findsubmod $self->schema_base ) {
+    $schema->require or croak "Can't load $schema: $@";
+    $generator->add_model( $schema );
+  }
+  my @statements = $generator->create_table_sql_statements;
+  $handle->begin_transaction;
+  $handle->simple_query( $_ ) foreach @statements;
+  $handle->commit;
+}
+
+sub record {
+  my ($self, $moniker, %options) = @_;
+
+  my $handle = $self->handle( %options );
+
+  my $package = $self->schema_base.'::'.$moniker;
+     $package->new( handle => $handle );
+}
+
+sub collection {
+  my ($self, $moniker, %options) = @_;
+
+  my $handle = $self->handle( %options );
+
+  # XXX: this may be double-edged
+  $moniker .= 'Collection' unless $moniker =~ /Collection$/;
+
+  my $package = $self->schema_base.'::'.$moniker;
+  $package->new( handle => $handle );
+}
+
+sub begin_transaction { shift->handle( @_ )->begin_transaction }
+sub commit            { shift->handle( @_ )->commit }
+sub rollback          { shift->handle( @_ )->rollback }
+
+sub simple_query      { shift->handle->simple_query( @_ ) }
+sub fetch_result      { shift->handle->fetch_result( @_ ) }
+
+sub trace {
+  my ($self, $code) = @_;
+
+  if ( ref $code eq 'CODE' ) {
+    $self->handle->log_sql_statements(1);
+    $self->handle->log_sql_hook( trace => $code );
+  }
+  elsif ( $code ) {
+    require Data::Dump;
+    $self->handle->log_sql_statements(1);
+    $self->handle->log_sql_hook(
+      trace => sub { print STDERR Data::Dump::dump(@_) }
+    );
+  }
+  else {
+    $self->handle->log_sql_statements(0);
+  }
+}
+
+1;
+
+__END__
+
+=head1 NAME
+
+Catalyst::Model::Jifty::DBI - Jifty::DBI Model Class with some magic on top
+
+=head1 SYNOPSIS
+
+In your model class:
+
+  package MyApp::Model:
+  use strict;
+  use base qw( Catalyst::Model::Jifty::DBI );
+  __PACKAGE__->config({
+      schema_base  => 'MyApp::Schema',
+      connect_info => {
+          driver   => 'SQLite',
+          database => 'myapp.db',
+      },
+  });
+  1;
+
+Or you may want to have multiple databases (for partitioning):
+
+  package MyApp::Model:
+  use strict;
+  use base qw( Catalyst::Model::Jifty::DBI );
+  __PACKAGE__->config({
+      schema_base => 'MyApp::Schema',
+      databases   => [
+          {
+              name => 'database1',
+              connect_info => {
+                  driver   => 'SQLite',
+                  database => 'myapp1.db',
+              },
+          },
+          {
+              name => 'database2',
+              connect_info => {
+                  driver   => 'SQLite',
+                  database => 'myapp2.db',
+              },
+          },
+      ],
+  });
+  1;
+
+Then in a controller:
+
+  my $record = $c->model('JDBI::Book');
+     $record->load_by_cols( name => 'foo' );
+
+  my $collection = $c->model('JDBI::BookCollection');
+     $collection->limit( column => 'name', value => 'bar',
+                         operator => 'MATCHES' );
+
+Or, you may want to do more explicitly
+
+  my $record = $c->model('JDBI')->record('Book');
+     $record->load_by_cols( name => 'foo' );
+
+  my $collection = $c->model('JDBI')->collection('BookCollection');
+     $collection->limit( column => 'name', value => 'bar',
+                         operator => 'MATCHES' );
+
+If you want some partitioning:
+
+  my $record_1 = $c->model('JDBI')
+                   ->record('Book', from => 'database1');
+  my $record_2 = $c->model('JDBI')
+                   ->record('Book', from => 'database2');
+
+  my $collection_1 = $c->model('JDBI')
+                       ->collection('BookCollection',
+                                    from => 'database1');
+  my $collection_2 = $c->model('JDBI')
+                       ->collection('BookCollection',
+                                    from => 'database2');
+
+You can also setup a database:
+
+  my $database = $c->model('JDBI')->database;
+  if ( -f $database ) {
+    $c->model('JDBI')->disconnect;
+    unlink $database;
+  }
+  $c->model('JDBI')->setup_database;
+
+You want more? or you don't want any more magic?
+
+  my $handle = $c->model('JDBI')->handle;
+  my $sth = $handle->simple_query( $sql_statement, @binds );
+
+  # Also you can write like this if you use a default handle:
+  my $sth = $c->model('JDBI')
+              ->simple_query( $sql_statement, @binds );
+
+When you want to debug (against the default handle):
+
+  $c->model('JDBI')->trace(1);  # start logging
+  $c->model('JDBI')->trace(0);  # stop logging
+
+=head1 BACKWARD INCOMPATIBILITY
+
+Current version of Catalyst::Model::Jifty::DBI was once called Catalyst::Model::JDBI::Schemas, which then replaced the original version written by Marcus Ramberg, by the request of Matt S. Trout (Catalyst Core team) to avoid future confusion. I wonder if anyone used the previous one, but note that APIs have been revamped and backward incompatible since 0.03.
+
+=head1 DESCRIPTION
+
+This is a Catalyst model for Jifty::DBI-based schemas, which may or may not be placed under your model class (if you don't want to place them under the model class, pass "schema_base" option to the model).  The model class automatically detect/load your schemas, like Catalyst::Model::DBIC::Schema does.
+
+This model also provides several features for laziness. You don't have to create simple Collection classes (they'll be created on the fly a la Jifty). No more writing schema in other language just to set up databases; C::M::Jifty::DBI takes care of it, on the fly if you want (of course from the perl schemas you prepared; converting raw SQLs to a database to perl schemas is not our way). You may want to use multiple databases of the same schema, or, you may prefer bloody raw SQL statements to complicated object chains. Here you are. Have fun!
+
+=head1 CONFIG
+
+=head2 schema_base
+
+The namespace to look for schema definitions in. All the schemas just below this namespace would be counted.
+
+=head2 connect_info
+
+A hash reference, which would be converted to a hash, then be passed to Jifty::DBI::Handle->new. See L<Jifty::DBI::Handle> for details.
+
+=head2 databases
+
+You may want to use multiple databases (for log rotation, load balancing etc). In this case you can provide multiple "connect_info" hash references under here, as shown in the SYNOPSIS. Actually, above "connect_info" hash reference would be moved in this "databases" array reference internally, with a default name "_" (underscore).
+
+=head1 METHODS
+
+=head2 new
+
+creates a model. Database connection may or may not be prepared, according to the number of connect_info. See above for the configuration.
+
+=head2 record
+
+creates and returns a corresponding (new) Jifty::DBI::Record object. Note that this is just a Record, not a Collection or a RecordSet of DBIC. That means, this object holds one and only single record, and usually you shouldn't reuse this object to let it hold another record. See examples:
+
+  # this works.
+  my $record = $c->model('JDBI')->record('Book');
+     $record->load_by_cols( id => 1 );
+     $record->set_name( 'new name' );  # now inserted/updated
+
+  # this may or may not work as you wish,
+  # depending on what you really want to do.
+  $c->model('JDBI')->record('Book')->load_by_cols( id => 1 );
+  $c->model('JDBI')->record('Book')->set_name( 'new name' );
+
+You can pass an optional hash, as shown in the SYNOPSIS.
+
+  # this tries to fetch a record from a table named 'books'
+  # in a database named 'database'.
+  my $record = $c->model('JDBI')->record('Book', from => 'database');
+
+You can omit "->record" when you fetch from a default database.
+
+  # both do the same thing
+  my $record = $c->model('JDBI')->record('Book');
+  my $record = $c->model('JDBI::Book');
+
+=head2 collection
+
+creates and returns a corresponding (new) Jifty::DBI::Collection object. If you haven't created a Collection class but only a Schema/Record class, this model creates a plain Collection class on the fly. I recommend not to omit the obvious 'Collection' part of the class name, but if you prefer, you can spare that when you explicitly call model("Model")->collection("Schema") (you can't omit if you follow the model("Model::Schema") convention). Other general usage and caveats are the same as ->record.
+
+  # this works.
+  my $collection = $c->model('JDBI')->collection('BookCollection');
+     $collection->unlimit;
+     $collection->limit( column => 'name', value => 'bar',
+                         operator => 'MATCHES' );
+
+  # this may or may not work as you wish,
+  # depending on what you really want to do.
+  $c->model('JDBI')->collection('BookCollection')->limit;
+  $c->model('JDBI')->collection('BookCollection')->first;
+
+You can pass an optional hash, as shown in the SYNOPSIS.
+
+  # this tries to fetch a collection from a table named 'books'
+  # in a database named 'database'.
+  my $collection = $c->model('JDBI')
+                     ->collection('BookCollection',
+                                  from => 'database');
+
+You can omit "->collection" when you fetch from a default database.
+
+  # both do the same thing
+  my $collection = $c->model('JDBI')->collection('BookCollection');
+  my $collection = $c->model('JDBI::BookCollection');
+
+=head2 simple_query
+
+When you want to do something irrelevant to a specific table, or something too complicated for Jifty::DBI, you can execute arbitrary statements with "simple_query", which is almost equivalent to DBI's $dbh->do or ->prepare. Note that this is supposed to use a default handle. If you want to use other handles, get the handle first with ->handle described below.
+
+  # fetch something from "tables" table,
+  # described in "(Your::Schema::)Table" schema/record class.
+  my $statement = 'select * from tables where id = ?';
+  my $sth = $c->model('JDBI')->simple_query( $statement, 1 );
+  return $sth ? $sth->fetchrow : undef;
+
+  # Above is equivalent to:
+  my $handle = $c->model('JDBI')->handle;
+  my $sth = $handle->simple_query( $statement, 1 );
+  return $sth ? $sth->fetchrow : undef;
+
+=head2 fetch_result
+
+This is a lazier shortcut to realize the example just shown above.
+
+  my $statement = 'select * from tables where id = ?';
+  my $row = $c->model('JDBI')->fetch_result( $statement, 1 );
+
+=head2 handle
+
+C::M::Jifty::DBI may have multiple JDBI handles. You can choose one you want to use like this:
+
+  my $handle = $c->model('JDBI')->handle( name => 'sample.db' );
+
+You can use "from" instead of "name". Also, you can use an alias to the real database name (connect_info->{database}) if you set "name" option in the config.
+
+  my $handle = $c->model('JDBI')->handle( from => 'alias' );
+
+By default, this returns a default handle.
+
+=head2 default_handle_name
+
+returns (or sets) a default handle/database name.
+
+=head2 databases
+
+returns all the database names/aliases registered in the config.
+
+  # See if all the registered SQLite databases have been set up.
+  foreach my $name ( $c->model('JDBI')->databases ) {
+    my $dbfile = $c->model('JDBI')->database( name => $name );
+    warn "database $db does not exist" unless -f $dbfile;
+    warn "database $db is blank" unless -s $dbfile;
+  }
+
+=head2 database
+
+returns a database name (or an actual path to the database for SQLite). See above for an example. You can pass an optional hash to specify database alias explicitly.
+
+  $c->model('JDBI')->database( name => 'alias' );
+
+=head2 setup_database
+
+You can set up database on the fly with your perl schema. You can pass an optional hash to specify target database.
+
+  $c->model('JDBI')->setup_database( name => 'database' );
+
+=head2 begin_transaction
+
+=head2 commit
+
+=head2 rollback
+
+These three are shortcuts to ->handle->(method_name). You can pass an optional hash to specify target database.
+
+=head2 disconnect
+
+This also is a shortcut to ->handle->disconnect. You can pass an optional hash to specify target database.
+
+=head2 trace
+
+turns on and off the logging of sql statements. If this is set to true, C::M::Jifty::DBI spits the info to STDERR. If you want finer control, give it a code reference.
+
+  $c->model('JDBI')->trace(sub {
+    my ($time, $statement, $binding, $duration, $result) = @_;
+    warn $statement, "\n", @$binding;
+  });
+
+See L<Jifty::DBI::Handle> for details (log_sql_hook / sql_statement_log).
+
+=head1 SEE ALSO
+
+L<Jifty::DBI>
+
+=head1 AUTHOR
+
+Kenichi Ishigaki, E<lt>ishigaki at cpan.orgE<gt>
+
+original version is written by Marcus Ramberg, E<lt>mramberg at cpan.orgE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2007 by Kenichi Ishigaki.
+
+This program is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
+
+=cut


Property changes on: Catalyst-Model-Jifty-DBI/1.0/trunk/lib/Catalyst/Model/Jifty/DBI.pm
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Catalyst-Model-Jifty-DBI/1.0/trunk/t/00_load.t
===================================================================
--- Catalyst-Model-Jifty-DBI/1.0/trunk/t/00_load.t	                        (rev 0)
+++ Catalyst-Model-Jifty-DBI/1.0/trunk/t/00_load.t	2008-05-06 14:15:22 UTC (rev 7684)
@@ -0,0 +1,5 @@
+use strict;
+use warnings;
+use Test::UseAllModules;
+
+BEGIN { all_uses_ok(); }


Property changes on: Catalyst-Model-Jifty-DBI/1.0/trunk/t/00_load.t
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Catalyst-Model-Jifty-DBI/1.0/trunk/t/10_testapp.t
===================================================================
--- Catalyst-Model-Jifty-DBI/1.0/trunk/t/10_testapp.t	                        (rev 0)
+++ Catalyst-Model-Jifty-DBI/1.0/trunk/t/10_testapp.t	2008-05-06 14:15:22 UTC (rev 7684)
@@ -0,0 +1,92 @@
+use strict;
+use warnings;
+use Test::More;
+use lib qw( t/TestApp/lib );
+
+BEGIN {
+  unless ( $ENV{TEST_C_M_JDBI} ) {
+    plan skip_all => 'set $ENV{TEST_C_M_JDBI} '.
+                     'to enable this test';
+  }
+}
+
+use Catalyst::Test qw( TestApp );
+
+my @tests_1 = (
+  'setup' => 1, 
+
+  # positive tests
+  'book'              => 1,
+  'book_collection'   => 'Perl Best Practices',
+
+  'author'            => 'DCONWAY',
+  'author_collection' => 'Damian Conway',
+
+  # negative tests
+  'book_false'              => 1,
+  'book_collection_false'   => 1,
+
+  'author_false'            => 1,
+  'author_collection_false' => 1,
+
+  'cleanup' => 1,
+);
+
+my @tests_2 = (
+  'setup' => 1, 
+
+  # default positive tests
+  'book'              => 1,
+  'book_collection'   => 'Perl Best Practices',
+
+  'author'            => 'DCONWAY',
+  'author_collection' => 'Damian Conway',
+
+  # default negative tests
+  'book_false'              => 1,
+  'book_collection_false'   => 1,
+
+  'author_false'            => 1,
+  'author_collection_false' => 1,
+
+  # db1 positive tests
+  'book_db1'              => 1,
+  'book_collection_db1'   => 'Perl Best Practices',
+
+  'author_db1'            => 'DCONWAY',
+  'author_collection_db1' => 'Damian Conway',
+
+  # db1 negative tests
+  'book_false_db1'              => 1,
+  'book_collection_false_db1'   => 1,
+
+  'author_false_db1'            => 1,
+  'author_collection_false_db1' => 1,
+
+  # db2 positive tests
+  'book_db2'              => 1,
+  'book_collection_db2'   => 'Catalyst',
+
+  'author_db2'            => 'JROCKWAY',
+  'author_collection_db2' => 'Jonathan Rockway',
+
+  # db2 negative tests
+  'book_false_db2'              => 1,
+  'book_collection_false_db2'   => 1,
+
+  'author_false_db2'            => 1,
+  'author_collection_false_db2' => 1,
+
+  'cleanup' => 1,
+);
+
+plan tests => (( scalar @tests_1 + scalar @tests_2 ) / 2 );
+
+while( my ($path, $result) = splice @tests_1, 0, 2 ) {
+  is get("/single/$path"), $result;
+}
+
+while( my ($path, $result) = splice @tests_2, 0, 2 ) {
+  is get("/multi/$path"), $result;
+}
+


Property changes on: Catalyst-Model-Jifty-DBI/1.0/trunk/t/10_testapp.t
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Catalyst-Model-Jifty-DBI/1.0/trunk/t/20_trace.t
===================================================================
--- Catalyst-Model-Jifty-DBI/1.0/trunk/t/20_trace.t	                        (rev 0)
+++ Catalyst-Model-Jifty-DBI/1.0/trunk/t/20_trace.t	2008-05-06 14:15:22 UTC (rev 7684)
@@ -0,0 +1,58 @@
+use strict;
+use warnings;
+use Test::More;
+use lib qw( t/TestApp/lib );
+
+BEGIN {
+  unless ( $ENV{TEST_C_M_JDBI} ) {
+    plan skip_all => 'set $ENV{TEST_C_M_JDBI} '.
+                     'to enable this test';
+  }
+  eval "require IO::Capture::Stderr";
+  if ( $@ ) {
+    plan skip_all => 'requires IO::Capture::Stderr';
+  }
+}
+
+plan tests => 4;
+
+use TestApp::Model::JDBI;
+
+my $model   = TestApp::Model::JDBI->new;
+my $capture = IO::Capture::Stderr->new;
+
+clear();
+
+$model->setup_database;
+
+ok !capture(), 'no log by default';
+
+$model->trace(1);
+
+ok capture(), 'logged';
+
+$model->trace(0);
+
+ok !capture(), 'log disabled';
+
+$model->trace(sub { print STDERR 'logged' });
+
+ok capture() eq 'logged', 'logger is replaced';
+
+END { clear() }
+
+sub clear {
+  if ( -f $model->database && -s $model->database ) {
+    $model->disconnect;
+    unlink $model->database;
+  }
+}
+
+sub capture {
+  $capture->start;
+  my $author = $model->record('Author');
+     $author->load(1);
+  $capture->stop;
+
+  return $capture->read;
+}


Property changes on: Catalyst-Model-Jifty-DBI/1.0/trunk/t/20_trace.t
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Catalyst-Model-Jifty-DBI/1.0/trunk/t/30_references.t
===================================================================
--- Catalyst-Model-Jifty-DBI/1.0/trunk/t/30_references.t	                        (rev 0)
+++ Catalyst-Model-Jifty-DBI/1.0/trunk/t/30_references.t	2008-05-06 14:15:22 UTC (rev 7684)
@@ -0,0 +1,55 @@
+use strict;
+use warnings;
+use Test::More 'no_plan';
+use lib qw( t/TestReference/lib );
+use TestReference::Model::JDBI;
+
+my $model = TestReference::Model::JDBI->new;
+
+if ( -f $model->database ) {
+  $model->disconnect;
+  unlink $model->database;
+}
+
+eval { $model->setup_database };
+ok !$@, 'setup database successfully';
+exit if $@;
+
+$model->trace(0);
+
+{ # prepare data
+  my $author = $model->record('Author');
+  my $author_id = $author->create( name => 'me' );
+
+  my $book1 = $model->record('Book');
+     $book1->create( name => 'A book', author => $author_id );
+  my $book2 = $model->record('Book');
+     $book2->create( name => 'Another book', author => $author_id );
+}
+
+{ # now test them
+  my $author = $model->record('Author');
+     $author->load_by_cols( name => 'me' );
+  ok $author->id;
+
+  my $books = $author->books;
+     $books->unlimit;
+  ok $books->isa('Jifty::DBI::Collection');
+  ok $books->count == 2;
+  ok $books->first->name eq 'A book';
+}
+
+{
+  my $book = $model->record('Book');
+     $book->load_by_cols( name => 'A book' );
+  ok $book->id;
+
+  my $author = $book->author;
+  ok $author->isa('Jifty::DBI::Record');
+  ok $author->name eq 'me';
+}
+
+END { # cleanup
+  $model->disconnect;
+  unlink $model->database;
+}


Property changes on: Catalyst-Model-Jifty-DBI/1.0/trunk/t/30_references.t
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Catalyst-Model-Jifty-DBI/1.0/trunk/t/99_pod.t
===================================================================
--- Catalyst-Model-Jifty-DBI/1.0/trunk/t/99_pod.t	                        (rev 0)
+++ Catalyst-Model-Jifty-DBI/1.0/trunk/t/99_pod.t	2008-05-06 14:15:22 UTC (rev 7684)
@@ -0,0 +1,8 @@
+use strict;
+use warnings;
+use Test::More;
+
+eval "use Test::Pod 1.18";
+plan skip_all => 'Test::Pod 1.18 required' if $@;
+plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
+all_pod_files_ok();


Property changes on: Catalyst-Model-Jifty-DBI/1.0/trunk/t/99_pod.t
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Catalyst-Model-Jifty-DBI/1.0/trunk/t/99_podcoverage.t
===================================================================
--- Catalyst-Model-Jifty-DBI/1.0/trunk/t/99_podcoverage.t	                        (rev 0)
+++ Catalyst-Model-Jifty-DBI/1.0/trunk/t/99_podcoverage.t	2008-05-06 14:15:22 UTC (rev 7684)
@@ -0,0 +1,9 @@
+use strict;
+use warnings;
+use Test::More;
+
+eval "use Test::Pod::Coverage 1.04";
+plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@;
+plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
+
+all_pod_coverage_ok();


Property changes on: Catalyst-Model-Jifty-DBI/1.0/trunk/t/99_podcoverage.t
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/Makefile.PL
===================================================================
--- Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/Makefile.PL	                        (rev 0)
+++ Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/Makefile.PL	2008-05-06 14:15:22 UTC (rev 7684)
@@ -0,0 +1,5 @@
+#
+# This is here just to let TestApp->path_to work.
+#
+
+1;


Property changes on: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/Makefile.PL
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Controller/Multi.pm
===================================================================
--- Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Controller/Multi.pm	                        (rev 0)
+++ Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Controller/Multi.pm	2008-05-06 14:15:22 UTC (rev 7684)
@@ -0,0 +1,395 @@
+package TestApp::Controller::Multi;
+
+use strict;
+use warnings;
+use base qw( Catalyst::Controller );
+
+sub setup : Local {
+  my ( $self, $c ) = @_;
+
+  $c->forward('cleanup', 1);  # remove previous database if any
+
+  foreach my $name ( $c->model('JDBI_M')->databases ) {
+    $c->model('JDBI_M')->setup_database( name => $name );
+  }
+
+  # insert default data
+  $c->model('JDBI_M')->record('Author', from => 'db1')->create(
+    name    => 'Damian Conway',
+    pauseid => 'DCONWAY',
+  );
+  $c->model('JDBI_M')->record('Author', from => 'db1')->create(
+    name    => 'chromatic',
+    pauseid => 'CHROMATIC',
+  );
+  $c->model('JDBI_M')->record('Author', from => 'db2')->create(
+    name    => 'Jonathan Rockway',
+    pauseid => 'JROCKWAY',
+  );
+  $c->model('JDBI_M')->record('Author', from => 'db2')->create(
+    name    => 'Mark Jason Dominus',
+    pauseid => 'MJD',
+  );
+
+  $c->model('JDBI_M')->record('Book', from => 'db1')->create(
+    name => 'Perl Best Practices',
+    isbn => '0-596-00173-8',
+  );
+  $c->model('JDBI_M')->record('Book', from => 'db1')->create(
+    name => 'Perl Hacks',
+    isbn => '0-596-52674-1',
+  );
+  $c->model('JDBI_M')->record('Book', from => 'db2')->create(
+    name => 'Catalyst',
+    isbn => '1-84719-095-2',
+  );
+  $c->model('JDBI_M')->record('Book', from => 'db2')->create(
+    name => 'Higher Order Perl',
+    isbn => '1-55860-701-3',
+  );
+
+  $c->response->body( 1 );
+}
+
+sub cleanup : Local {
+  my ( $self, $c, $no_return ) = @_;
+
+  foreach my $name ( $c->model('JDBI_M')->databases ) {
+    my $testdb = $c->model('JDBI_M')->database( name => $name );
+
+    return unless -e $testdb;
+
+    # to avoid Permission issue on some platforms
+    $c->model('JDBI_M')->disconnect( name => $name );
+
+    unlink $testdb or die "Can't remove previous database: $!";
+  }
+
+  unless ( $no_return ) {
+    $c->response->body( 1 );
+  }
+}
+
+sub book : Local {
+  my ( $self, $c ) = @_;
+
+  my $book = $c->model('JDBI_M::Book');
+     $book->load(1);
+  if ( $book->id ) {
+    $c->response->body( $book->id );
+  }
+  else {
+    $c->response->body( 0 );
+  }
+}
+
+sub book_collection : Local {
+  my ( $self, $c ) = @_;
+
+  my $books = $c->model('JDBI_M::BookCollection');
+     $books->unlimit;
+  if ( $books->first ) {
+    $c->response->body( $books->first->name );
+  }
+  else {
+    $c->response->body( 0 );
+  }
+}
+
+sub author : Local {
+  my ( $self, $c ) = @_;
+
+  my $author = $c->model('JDBI_M::Author');
+     $author->load(1);
+  if ( $author->id ) {
+    $c->response->body( $author->pauseid );
+  }
+  else {
+    $c->response->body( 0 );
+  }
+}
+
+sub author_collection : Local {
+  my ( $self, $c ) = @_;
+
+  # This collection is provided automatically by C::M::Jifty::DBI!
+  my $authors = $c->model('JDBI_M::AuthorCollection');
+     $authors->unlimit;
+  if ( $authors->first ) {
+    $c->response->body( $authors->first->name );
+  }
+  else {
+    $c->response->body( 0 );
+  }
+}
+
+sub book_false : Local {
+  my ( $self, $c ) = @_;
+
+  my $book = $c->model('JDBI_M::Book');
+     $book->load_by_cols( name => 'my book');
+  if ( $book->id ) {
+    $c->response->body( 0 );  # shouldn't be found
+  }
+  else {
+    $c->response->body( 1 );
+  }
+}
+
+sub book_collection_false : Local {
+  my ( $self, $c ) = @_;
+
+  my $books = $c->model('JDBI_M::BookCollection');
+     $books->limit( column => 'name', value => 'my book' );
+  if ( $books->first ) {
+    $c->response->body( 0 ); # shouldn't be found
+  }
+  else {
+    $c->response->body( 1 );
+  }
+}
+
+sub author_false : Local {
+  my ( $self, $c ) = @_;
+
+  my $author = $c->model('JDBI_M::Author');
+     $author->load_by_cols( name => 'nowhere man' );
+  if ( $author->id ) {
+    $c->response->body( 0 ); # shouldn't be found
+  }
+  else {
+    $c->response->body( 1 );
+  }
+}
+
+sub author_collection_false : Local {
+  my ( $self, $c ) = @_;
+
+  # This collection is provided automatically by C::M::Jifty::DBI!
+  my $authors = $c->model('JDBI_M::AuthorCollection');
+     $authors->limit( column => 'pauseid', value => 'FOOBAR' );
+  if ( $authors->first ) {
+    $c->response->body( 0 ); # shouldn't be found
+  }
+  else {
+    $c->response->body( 1 );
+  }
+}
+
+# db1
+
+sub book_db1 : Local {
+  my ( $self, $c ) = @_;
+
+  my $book = $c->model('JDBI_M')->record('Book', name => 'db1');
+     $book->load(1);
+  if ( $book->id ) {
+    $c->response->body( $book->id );
+  }
+  else {
+    $c->response->body( 0 );
+  }
+}
+
+sub book_collection_db1 : Local {
+  my ( $self, $c ) = @_;
+
+  my $books = $c->model('JDBI_M')->collection('BookCollection', name => 'db1');
+     $books->unlimit;
+  if ( $books->first ) {
+    $c->response->body( $books->first->name );
+  }
+  else {
+    $c->response->body( 0 );
+  }
+}
+
+sub author_db1 : Local {
+  my ( $self, $c ) = @_;
+
+  my $author = $c->model('JDBI_M')->record('Author', name => 'db1');
+     $author->load(1);
+  if ( $author->id ) {
+    $c->response->body( $author->pauseid );
+  }
+  else {
+    $c->response->body( 0 );
+  }
+}
+
+sub author_collection_db1 : Local {
+  my ( $self, $c ) = @_;
+
+  # This collection is provided automatically by C::M::Jifty::DBI!
+  my $authors = $c->model('JDBI_M')->collection('AuthorCollection', name => 'db1');
+     $authors->unlimit;
+  if ( $authors->first ) {
+    $c->response->body( $authors->first->name );
+  }
+  else {
+    $c->response->body( 0 );
+  }
+}
+
+sub book_false_db1 : Local {
+  my ( $self, $c ) = @_;
+
+  my $book = $c->model('JDBI_M')->record('Book', name => 'db1');
+     $book->load_by_cols( name => 'my book');
+  if ( $book->id ) {
+    $c->response->body( 0 );  # shouldn't be found
+  }
+  else {
+    $c->response->body( 1 );
+  }
+}
+
+sub book_collection_false_db1 : Local {
+  my ( $self, $c ) = @_;
+
+  my $books = $c->model('JDBI_M')->collection('BookCollection', name => 'db1');
+     $books->limit( column => 'name', value => 'my book' );
+  if ( $books->first ) {
+    $c->response->body( 0 ); # shouldn't be found
+  }
+  else {
+    $c->response->body( 1 );
+  }
+}
+
+sub author_false_db1 : Local {
+  my ( $self, $c ) = @_;
+
+  my $author = $c->model('JDBI_M')->record('Author', name => 'db1');
+     $author->load_by_cols( name => 'nowhere man' );
+  if ( $author->id ) {
+    $c->response->body( 0 ); # shouldn't be found
+  }
+  else {
+    $c->response->body( 1 );
+  }
+}
+
+sub author_collection_false_db1 : Local {
+  my ( $self, $c ) = @_;
+
+  # This collection is provided automatically by C::M::Jifty::DBI!
+  my $authors = $c->model('JDBI_M')->collection('AuthorCollection', name => 'db1');
+     $authors->limit( column => 'pauseid', value => 'FOOBAR' );
+  if ( $authors->first ) {
+    $c->response->body( 0 ); # shouldn't be found
+  }
+  else {
+    $c->response->body( 1 );
+  }
+}
+
+# db2
+
+sub book_db2 : Local {
+  my ( $self, $c ) = @_;
+
+  my $book = $c->model('JDBI_M')->record('Book', name => 'db2');
+     $book->load(1);
+  if ( $book->id ) {
+    $c->response->body( $book->id );
+  }
+  else {
+    $c->response->body( 0 );
+  }
+}
+
+sub book_collection_db2 : Local {
+  my ( $self, $c ) = @_;
+
+  my $books = $c->model('JDBI_M')->collection('BookCollection', name => 'db2');
+     $books->unlimit;
+  if ( $books->first ) {
+    $c->response->body( $books->first->name );
+  }
+  else {
+    $c->response->body( 0 );
+  }
+}
+
+sub author_db2 : Local {
+  my ( $self, $c ) = @_;
+
+  my $author = $c->model('JDBI_M')->record('Author', name => 'db2');
+     $author->load(1);
+  if ( $author->id ) {
+    $c->response->body( $author->pauseid );
+  }
+  else {
+    $c->response->body( 0 );
+  }
+}
+
+sub author_collection_db2 : Local {
+  my ( $self, $c ) = @_;
+
+  # This collection is provided automatically by C::M::Jifty::DBI!
+  my $authors = $c->model('JDBI_M')->collection('AuthorCollection', name => 'db2');
+     $authors->unlimit;
+  if ( $authors->first ) {
+    $c->response->body( $authors->first->name );
+  }
+  else {
+    $c->response->body( 0 );
+  }
+}
+
+sub book_false_db2 : Local {
+  my ( $self, $c ) = @_;
+
+  my $book = $c->model('JDBI_M')->record('Book', name => 'db2');
+     $book->load_by_cols( name => 'my book');
+  if ( $book->id ) {
+    $c->response->body( 0 );  # shouldn't be found
+  }
+  else {
+    $c->response->body( 1 );
+  }
+}
+
+sub book_collection_false_db2 : Local {
+  my ( $self, $c ) = @_;
+
+  my $books = $c->model('JDBI_M')->collection('BookCollection', name => 'db2');
+     $books->limit( column => 'name', value => 'my book' );
+  if ( $books->first ) {
+    $c->response->body( 0 ); # shouldn't be found
+  }
+  else {
+    $c->response->body( 1 );
+  }
+}
+
+sub author_false_db2 : Local {
+  my ( $self, $c ) = @_;
+
+  my $author = $c->model('JDBI_M')->record('Author', name => 'db2');
+     $author->load_by_cols( name => 'nowhere man' );
+  if ( $author->id ) {
+    $c->response->body( 0 ); # shouldn't be found
+  }
+  else {
+    $c->response->body( 1 );
+  }
+}
+
+sub author_collection_false_db2 : Local {
+  my ( $self, $c ) = @_;
+
+  # This collection is provided automatically by C::M::Jifty::DBI!
+  my $authors = $c->model('JDBI_M')->collection('AuthorCollection', name => 'db2');
+     $authors->limit( column => 'pauseid', value => 'FOOBAR' );
+  if ( $authors->first ) {
+    $c->response->body( 0 ); # shouldn't be found
+  }
+  else {
+    $c->response->body( 1 );
+  }
+}
+
+1;


Property changes on: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Controller/Multi.pm
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Controller/Single.pm
===================================================================
--- Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Controller/Single.pm	                        (rev 0)
+++ Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Controller/Single.pm	2008-05-06 14:15:22 UTC (rev 7684)
@@ -0,0 +1,159 @@
+package TestApp::Controller::Single;
+
+use strict;
+use warnings;
+use base qw( Catalyst::Controller );
+
+sub setup : Local {
+  my ( $self, $c ) = @_;
+
+  $c->forward('cleanup', 1);  # remove previous database if any
+
+  $c->model('JDBI')->setup_database;
+
+  # insert default data
+  $c->model('JDBI::Book')->create(
+    name => 'Perl Best Practices',
+    isbn => '0-596-00173-8',
+  );
+  $c->model('JDBI::Book')->create(
+    name => 'Perl Hacks',
+    isbn => '0-596-52674-1',
+  );
+
+  $c->model('JDBI::Author')->create(
+    name    => 'Damian Conway',
+    pauseid => 'DCONWAY',
+  );
+  $c->model('JDBI::Author')->create(
+    name    => 'chromatic',
+    pauseid => 'CHROMATIC',
+  );
+
+  $c->response->body( 1 );
+}
+
+sub cleanup : Local {
+  my ( $self, $c, $no_return ) = @_;
+
+  my $testdb = $c->model('JDBI')->database;
+
+  return unless -e $testdb;
+
+  # to avoid Permission issue on some platforms
+  $c->model('JDBI')->disconnect;
+
+  unlink $testdb or die "Can't remove previous database: $!";
+
+  unless ( $no_return ) {
+    $c->response->body( 1 );
+  }
+}
+
+sub book : Local {
+  my ( $self, $c ) = @_;
+
+  my $book = $c->model('JDBI::Book');
+     $book->load(1);
+  if ( $book->id ) {
+    $c->response->body( $book->id );
+  }
+  else {
+    $c->response->body( 0 );
+  }
+}
+
+sub book_collection : Local {
+  my ( $self, $c ) = @_;
+
+  my $books = $c->model('JDBI::BookCollection');
+     $books->unlimit;
+  if ( $books->first ) {
+    $c->response->body( $books->first->name );
+  }
+  else {
+    $c->response->body( 0 );
+  }
+}
+
+sub author : Local {
+  my ( $self, $c ) = @_;
+
+  my $author = $c->model('JDBI::Author');
+     $author->load(1);
+  if ( $author->id ) {
+    $c->response->body( $author->pauseid );
+  }
+  else {
+    $c->response->body( 0 );
+  }
+}
+
+sub author_collection : Local {
+  my ( $self, $c ) = @_;
+
+  # This collection is provided automatically by C::M::Jifty::DBI!
+  my $authors = $c->model('JDBI::AuthorCollection');
+     $authors->unlimit;
+  if ( $authors->first ) {
+    $c->response->body( $authors->first->name );
+  }
+  else {
+    $c->response->body( 0 );
+  }
+}
+
+sub book_false : Local {
+  my ( $self, $c ) = @_;
+
+  my $book = $c->model('JDBI::Book');
+     $book->load_by_cols( name => 'my book');
+  if ( $book->id ) {
+    $c->response->body( 0 );  # shouldn't be found
+  }
+  else {
+    $c->response->body( 1 );
+  }
+}
+
+sub book_collection_false : Local {
+  my ( $self, $c ) = @_;
+
+  my $books = $c->model('JDBI::BookCollection');
+     $books->limit( column => 'name', value => 'my book' );
+  if ( $books->first ) {
+    $c->response->body( 0 ); # shouldn't be found
+  }
+  else {
+    $c->response->body( 1 );
+  }
+}
+
+sub author_false : Local {
+  my ( $self, $c ) = @_;
+
+  my $author = $c->model('JDBI::Author');
+     $author->load_by_cols( name => 'nowhere man' );
+  if ( $author->id ) {
+    $c->response->body( 0 ); # shouldn't be found
+  }
+  else {
+    $c->response->body( 1 );
+  }
+}
+
+sub author_collection_false : Local {
+  my ( $self, $c ) = @_;
+
+  # This collection is provided automatically by C::M::Jifty::DBI!
+  my $authors = $c->model('JDBI::AuthorCollection');
+     $authors->limit( column => 'pauseid', value => 'FOOBAR' );
+  if ( $authors->first ) {
+    $c->response->body( 0 ); # shouldn't be found
+  }
+  else {
+    $c->response->body( 1 );
+  }
+}
+
+1;


Property changes on: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Controller/Single.pm
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Model/JDBI.pm
===================================================================
--- Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Model/JDBI.pm	                        (rev 0)
+++ Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Model/JDBI.pm	2008-05-06 14:15:22 UTC (rev 7684)
@@ -0,0 +1,15 @@
+package TestApp::Model::JDBI;
+
+use strict;
+use warnings;
+use base qw( Catalyst::Model::Jifty::DBI );
+
+__PACKAGE__->config(
+  schema_base  => 'TestApp::Schema',
+  connect_info => {
+    driver   => 'SQLite',
+    database => 'testdb',
+  }
+);
+
+1;


Property changes on: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Model/JDBI.pm
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Model/JDBI_M.pm
===================================================================
--- Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Model/JDBI_M.pm	                        (rev 0)
+++ Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Model/JDBI_M.pm	2008-05-06 14:15:22 UTC (rev 7684)
@@ -0,0 +1,27 @@
+package TestApp::Model::JDBI_M;
+
+use strict;
+use warnings;
+use base qw( Catalyst::Model::Jifty::DBI );
+
+__PACKAGE__->config(
+  schema_base  => 'TestApp::Schema',
+  databases => [
+    {
+      name => 'db1',
+      connect_info => {
+        driver   => 'SQLite',
+        database => 'testdb1',
+      },
+    },
+    {
+      name => 'db2',
+      connect_info => {
+        driver   => 'SQLite',
+        database => 'testdb2',
+      },
+    },
+  ],
+);
+
+1;


Property changes on: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Model/JDBI_M.pm
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Plugin/ErrorMessage.pm
===================================================================
--- Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Plugin/ErrorMessage.pm	                        (rev 0)
+++ Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Plugin/ErrorMessage.pm	2008-05-06 14:15:22 UTC (rev 7684)
@@ -0,0 +1,14 @@
+package TestApp::Plugin::ErrorMessage;
+
+use strict;
+use warnings;
+
+sub finalize_error {
+  my $c = shift;
+
+  my $error = join ' ', ( ref $c->error eq 'ARRAY' ? @{ $c->error }
+                                                   : ( $c->error ));
+  $c->response->body( $error );
+}
+
+1;


Property changes on: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Plugin/ErrorMessage.pm
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Schema/Author.pm
===================================================================
--- Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Schema/Author.pm	                        (rev 0)
+++ Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Schema/Author.pm	2008-05-06 14:15:22 UTC (rev 7684)
@@ -0,0 +1,11 @@
+package TestApp::Schema::Author;
+
+use strict;
+use warnings;
+use Jifty::DBI::Schema;
+use Jifty::DBI::Record schema {
+  column name    => type is 'text';
+  column pauseid => type is 'text';
+};
+
+1;


Property changes on: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Schema/Author.pm
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Schema/Book.pm
===================================================================
--- Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Schema/Book.pm	                        (rev 0)
+++ Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Schema/Book.pm	2008-05-06 14:15:22 UTC (rev 7684)
@@ -0,0 +1,11 @@
+package TestApp::Schema::Book;
+
+use strict;
+use warnings;
+use Jifty::DBI::Schema;
+use Jifty::DBI::Record schema {
+  column name => type is 'text';
+  column isbn => type is 'text';
+};
+
+1;


Property changes on: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Schema/Book.pm
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Schema/BookCollection.pm
===================================================================
--- Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Schema/BookCollection.pm	                        (rev 0)
+++ Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Schema/BookCollection.pm	2008-05-06 14:15:22 UTC (rev 7684)
@@ -0,0 +1,7 @@
+package TestApp::Schema::BookCollection;
+
+use strict;
+use warnings;
+use base qw( Jifty::DBI::Collection );
+
+1;


Property changes on: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp/Schema/BookCollection.pm
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp.pm
===================================================================
--- Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp.pm	                        (rev 0)
+++ Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp.pm	2008-05-06 14:15:22 UTC (rev 7684)
@@ -0,0 +1,10 @@
+package TestApp;
+
+use strict;
+use warnings;
+use Catalyst::Runtime '5.70';
+use Catalyst qw( +TestApp::Plugin::ErrorMessage );
+
+__PACKAGE__->setup;
+
+1;


Property changes on: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestApp/lib/TestApp.pm
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestReference/lib/TestReference/Model/JDBI.pm
===================================================================
--- Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestReference/lib/TestReference/Model/JDBI.pm	                        (rev 0)
+++ Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestReference/lib/TestReference/Model/JDBI.pm	2008-05-06 14:15:22 UTC (rev 7684)
@@ -0,0 +1,12 @@
+package TestReference::Model::JDBI;
+
+use strict;
+use warnings;
+use base qw( Catalyst::Model::Jifty::DBI );
+
+__PACKAGE__->config(
+  schema_base  => 'TestReference::Schema',
+  connect_info => { driver => 'SQLite', database => 'testdb3' },
+);
+
+1;


Property changes on: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestReference/lib/TestReference/Model/JDBI.pm
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestReference/lib/TestReference/Schema/Author.pm
===================================================================
--- Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestReference/lib/TestReference/Schema/Author.pm	                        (rev 0)
+++ Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestReference/lib/TestReference/Schema/Author.pm	2008-05-06 14:15:22 UTC (rev 7684)
@@ -0,0 +1,12 @@
+package TestReference::Schema::Author;
+
+use strict;
+use warnings;
+use Jifty::DBI::Schema;
+use Jifty::DBI::Record schema {
+  column name => type is 'text';
+  column books =>
+    references TestReference::Schema::BookCollection by 'author';
+};
+
+1;


Property changes on: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestReference/lib/TestReference/Schema/Author.pm
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestReference/lib/TestReference/Schema/Book.pm
===================================================================
--- Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestReference/lib/TestReference/Schema/Book.pm	                        (rev 0)
+++ Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestReference/lib/TestReference/Schema/Book.pm	2008-05-06 14:15:22 UTC (rev 7684)
@@ -0,0 +1,11 @@
+package TestReference::Schema::Book;
+
+use strict;
+use warnings;
+use Jifty::DBI::Schema;
+use Jifty::DBI::Record schema {
+  column name   => type is 'text';
+  column author => references TestReference::Schema::Author;
+};
+
+1;
\ No newline at end of file


Property changes on: Catalyst-Model-Jifty-DBI/1.0/trunk/t/TestReference/lib/TestReference/Schema/Book.pm
___________________________________________________________________
Name: svn:eol-style
   + native




More information about the Catalyst-commits mailing list