[Bast-commits] r6399 - in DBIx-Class/0.08/trunk: lib/DBIx/Class/CDBICompat lib/DBIx/Class/Storage/DBI/ODBC t t/lib/DBICTest/Schema

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Sun May 24 13:00:50 GMT 2009


Author: ribasushi
Date: 2009-05-24 13:00:50 +0000 (Sun, 24 May 2009)
New Revision: 6399

Modified:
   DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat/Pager.pm
   DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/ODBC/ACCESS.pm
   DBIx-Class/0.08/trunk/t/42toplimit.t
   DBIx-Class/0.08/trunk/t/46where_attribute.t
   DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/BooksInLibrary.pm
   DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Collection.pm
   DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/CollectionObject.pm
   DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Owners.pm
   DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/SelfRef.pm
   DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/SelfRefAlias.pm
Log:
eol adjustments

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat/Pager.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat/Pager.pm	2009-05-24 12:12:39 UTC (rev 6398)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat/Pager.pm	2009-05-24 13:00:50 UTC (rev 6399)
@@ -1,19 +1,19 @@
 package # hide from PAUSE
     DBIx::Class::CDBICompat::Pager;
-
+
 use strict;
 use warnings FATAL => 'all';
-
+
 *pager = \&page;
-
+
 sub page {
   my $class = shift;
-
+
   my $rs = $class->search(@_);
   unless ($rs->{attrs}{page}) {
     $rs = $rs->page(1);
   }
   return ( $rs->pager, $rs );
 }
-
+
 1;

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/ODBC/ACCESS.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/ODBC/ACCESS.pm	2009-05-24 12:12:39 UTC (rev 6398)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/ODBC/ACCESS.pm	2009-05-24 13:00:50 UTC (rev 6399)
@@ -1,127 +1,127 @@
-package DBIx::Class::Storage::DBI::ODBC::ACCESS;
-use strict;
-use warnings;
-
-use DBI;
-use base qw/DBIx::Class::Storage::DBI/;
-
-my $ERR_MSG_START = __PACKAGE__ . ' failed: ';
-
-sub insert {
-    my $self = shift;
-    my ( $source, $to_insert ) = @_;
-
-    my $bind_attributes = $self->source_bind_attributes( $source );
-    my ( undef, $sth ) = $self->_execute( 'insert' => [], $source, $bind_attributes, $to_insert );
-
-    #store the identity here since @@IDENTITY is connection global and this prevents
-    #possibility that another insert to a different table overwrites it for this resultsource
-    my $identity = 'SELECT @@IDENTITY';
-    my $max_sth  = $self->{ _dbh }->prepare( $identity )
-        or $self->throw_exception( $ERR_MSG_START . $self->{ _dbh }->errstr() );
-    $max_sth->execute() or $self->throw_exception( $ERR_MSG_START . $max_sth->errstr );
-
-    my $row = $max_sth->fetchrow_arrayref()
-        or $self->throw_exception( $ERR_MSG_START . "$identity did not return any result." );
-
-    $self->{ last_pk }->{ $source->name() } = $row;
-
-    return $to_insert;
-}
-
-sub last_insert_id {
-    my $self = shift;
-    my ( $result_source ) = @_;
-
-    return @{ $self->{ last_pk }->{ $result_source->name() } };
-}
-
-sub bind_attribute_by_data_type {
-    my $self = shift;
-    
-    my ( $data_type ) = @_;
-    
-    return { TYPE => $data_type } if $data_type == DBI::SQL_LONGVARCHAR;
-    
-    return;
-}
-
-sub sqlt_type { 'ACCESS' }
-
-1;
-
-=head1 NAME
-
-DBIx::Class::Storage::DBI::ODBC::ACCESS - Support specific to MS Access over ODBC
-
-=head1 WARNING
-
-I am not a DBI, DBIx::Class or MS Access guru. Use this module with that in
-mind.
-
-This module is currently considered alpha software and can change without notice.
-
-=head1 DESCRIPTION
-
-This class implements support specific to Microsoft Access over ODBC.
-
-It is loaded automatically by by DBIx::Class::Storage::DBI::ODBC when it
-detects a MS Access back-end.
-
-=head1 SUPPORTED VERSIONS
-
-This module have currently only been tested on MS Access 2003 using the Jet 4.0 engine.
-
-As far as my knowledge it should work on MS Access 2000 or later, but that have not been tested.
-Information about support for different version of MS Access is welcome.
-
-=head1 IMPLEMENTATION NOTES
-
-MS Access supports the @@IDENTITY function for retriving the id of the latest inserted row.
-@@IDENTITY is global to the connection, so to support the possibility of getting the last inserted
-id for different tables, the insert() function stores the inserted id on a per table basis.
-last_insert_id() then just returns the stored value.
-
-=head1 KNOWN ACCESS PROBLEMS
-
-=over
-
-=item Invalid precision value
-
-This error message is received when trying to store more than 255 characters in a MEMO field.
-The problem is (to my knowledge) an error in the MS Access ODBC driver. The problem is fixed
-by setting the C<data_type> of the column to C<SQL_LONGVARCHAR> in C<add_columns>. 
-C<SQL_LONGVARCHAR> is a constant in the C<DBI> module.
-
-=back
-
-=head1 IMPLEMENTED FUNCTIONS
-
-=head2 bind_attribute_by_data_type
-
-This function currently supports the SQL_LONGVARCHAR column type.
-
-=head2 insert
-
-=head2 last_insert_id
-
-=head2 sqlt_type
-
-=head1 BUGS
-
-Most likely. Bug reports are welcome.
-
-=head1 AUTHORS
-
-Øystein Torget C<< <oystein.torget at dnv.com> >>
-
-=head1 COPYRIGHT
-
-You may distribute this code under the same terms as Perl itself.
-
-Det Norske Veritas AS (DNV)
-
-http://www.dnv.com
-
-=cut
-
+package DBIx::Class::Storage::DBI::ODBC::ACCESS;
+use strict;
+use warnings;
+
+use DBI;
+use base qw/DBIx::Class::Storage::DBI/;
+
+my $ERR_MSG_START = __PACKAGE__ . ' failed: ';
+
+sub insert {
+    my $self = shift;
+    my ( $source, $to_insert ) = @_;
+
+    my $bind_attributes = $self->source_bind_attributes( $source );
+    my ( undef, $sth ) = $self->_execute( 'insert' => [], $source, $bind_attributes, $to_insert );
+
+    #store the identity here since @@IDENTITY is connection global and this prevents
+    #possibility that another insert to a different table overwrites it for this resultsource
+    my $identity = 'SELECT @@IDENTITY';
+    my $max_sth  = $self->{ _dbh }->prepare( $identity )
+        or $self->throw_exception( $ERR_MSG_START . $self->{ _dbh }->errstr() );
+    $max_sth->execute() or $self->throw_exception( $ERR_MSG_START . $max_sth->errstr );
+
+    my $row = $max_sth->fetchrow_arrayref()
+        or $self->throw_exception( $ERR_MSG_START . "$identity did not return any result." );
+
+    $self->{ last_pk }->{ $source->name() } = $row;
+
+    return $to_insert;
+}
+
+sub last_insert_id {
+    my $self = shift;
+    my ( $result_source ) = @_;
+
+    return @{ $self->{ last_pk }->{ $result_source->name() } };
+}
+
+sub bind_attribute_by_data_type {
+    my $self = shift;
+    
+    my ( $data_type ) = @_;
+    
+    return { TYPE => $data_type } if $data_type == DBI::SQL_LONGVARCHAR;
+    
+    return;
+}
+
+sub sqlt_type { 'ACCESS' }
+
+1;
+
+=head1 NAME
+
+DBIx::Class::Storage::DBI::ODBC::ACCESS - Support specific to MS Access over ODBC
+
+=head1 WARNING
+
+I am not a DBI, DBIx::Class or MS Access guru. Use this module with that in
+mind.
+
+This module is currently considered alpha software and can change without notice.
+
+=head1 DESCRIPTION
+
+This class implements support specific to Microsoft Access over ODBC.
+
+It is loaded automatically by by DBIx::Class::Storage::DBI::ODBC when it
+detects a MS Access back-end.
+
+=head1 SUPPORTED VERSIONS
+
+This module have currently only been tested on MS Access 2003 using the Jet 4.0 engine.
+
+As far as my knowledge it should work on MS Access 2000 or later, but that have not been tested.
+Information about support for different version of MS Access is welcome.
+
+=head1 IMPLEMENTATION NOTES
+
+MS Access supports the @@IDENTITY function for retriving the id of the latest inserted row.
+@@IDENTITY is global to the connection, so to support the possibility of getting the last inserted
+id for different tables, the insert() function stores the inserted id on a per table basis.
+last_insert_id() then just returns the stored value.
+
+=head1 KNOWN ACCESS PROBLEMS
+
+=over
+
+=item Invalid precision value
+
+This error message is received when trying to store more than 255 characters in a MEMO field.
+The problem is (to my knowledge) an error in the MS Access ODBC driver. The problem is fixed
+by setting the C<data_type> of the column to C<SQL_LONGVARCHAR> in C<add_columns>. 
+C<SQL_LONGVARCHAR> is a constant in the C<DBI> module.
+
+=back
+
+=head1 IMPLEMENTED FUNCTIONS
+
+=head2 bind_attribute_by_data_type
+
+This function currently supports the SQL_LONGVARCHAR column type.
+
+=head2 insert
+
+=head2 last_insert_id
+
+=head2 sqlt_type
+
+=head1 BUGS
+
+Most likely. Bug reports are welcome.
+
+=head1 AUTHORS
+
+Øystein Torget C<< <oystein.torget at dnv.com> >>
+
+=head1 COPYRIGHT
+
+You may distribute this code under the same terms as Perl itself.
+
+Det Norske Veritas AS (DNV)
+
+http://www.dnv.com
+
+=cut
+

Modified: DBIx-Class/0.08/trunk/t/42toplimit.t
===================================================================
--- DBIx-Class/0.08/trunk/t/42toplimit.t	2009-05-24 12:12:39 UTC (rev 6398)
+++ DBIx-Class/0.08/trunk/t/42toplimit.t	2009-05-24 13:00:50 UTC (rev 6399)
@@ -1,45 +1,45 @@
-use strict;
-use warnings;
-
-use Test::More;
-use DBIx::Class::Storage::DBI;
-use lib qw(t/lib);
-use DBICTest; # do not remove even though it is not used
-use DBIC::SqlMakerTest;
-
-plan tests => 8;
-
-my $sa = new DBIx::Class::SQLAHacks;
-$sa->limit_dialect( 'Top' );
-
-sub test_order {
-  my $args = shift;
-  my $order_by = $args->{order_by};
-  my $expected_sql_order = $args->{expected_sql_order};
-
-  my $query = $sa->select( 'foo', [qw{bar baz}], undef, {
-      order_by => $order_by,
-     }, 1, 3
-  );
-  is_same_sql(
-    $query,
-    "SELECT * FROM ( SELECT TOP 1 * FROM ( SELECT TOP 4 bar,baz FROM foo ORDER BY $expected_sql_order->[0] ) AS foo ORDER BY $expected_sql_order->[1] ) AS bar ORDER BY $expected_sql_order->[0]",
-  );
-}
-
-  test_order({ order_by => \'foo DESC'       , expected_sql_order => [ 'foo DESC', 'foo ASC' ] });
-  test_order({ order_by => 'foo'             , expected_sql_order => [ 'foo ASC', 'foo DESC'] });
-  test_order({ order_by => [ qw{ foo bar}   ], expected_sql_order => [ 'foo ASC,bar ASC', 'foo DESC, bar DESC']});
-  test_order({ order_by => { -asc => 'foo'  }, expected_sql_order => [ 'foo ASC', 'foo DESC' ] });
-  test_order({ order_by => { -desc => 'foo' }, expected_sql_order => [ 'foo DESC', 'foo ASC' ] });
-
-  test_order({ order_by => ['foo', { -desc => 'bar' } ], expected_sql_order => [ 'foo ASC, bar DESC', 'foo DESC, bar ASC'] });
-  test_order({ order_by => {-asc => [qw{ foo bar }] }, expected_sql_order => ['foo ASC, bar ASC', 'foo DESC, bar DESC' ] });
-  test_order({ order_by =>
-      [
-        { -asc => 'foo' },
-        { -desc => [qw{bar}] },
-        { -asc  => [qw{baz frew}]},
-      ],
-      expected_sql_order => ['foo ASC, bar DESC, baz ASC, frew ASC', 'foo DESC, bar ASC, baz DESC, frew DESC']
-  });
+use strict;
+use warnings;
+
+use Test::More;
+use DBIx::Class::Storage::DBI;
+use lib qw(t/lib);
+use DBICTest; # do not remove even though it is not used
+use DBIC::SqlMakerTest;
+
+plan tests => 8;
+
+my $sa = new DBIx::Class::SQLAHacks;
+$sa->limit_dialect( 'Top' );
+
+sub test_order {
+  my $args = shift;
+  my $order_by = $args->{order_by};
+  my $expected_sql_order = $args->{expected_sql_order};
+
+  my $query = $sa->select( 'foo', [qw{bar baz}], undef, {
+      order_by => $order_by,
+     }, 1, 3
+  );
+  is_same_sql(
+    $query,
+    "SELECT * FROM ( SELECT TOP 1 * FROM ( SELECT TOP 4 bar,baz FROM foo ORDER BY $expected_sql_order->[0] ) AS foo ORDER BY $expected_sql_order->[1] ) AS bar ORDER BY $expected_sql_order->[0]",
+  );
+}
+
+  test_order({ order_by => \'foo DESC'       , expected_sql_order => [ 'foo DESC', 'foo ASC' ] });
+  test_order({ order_by => 'foo'             , expected_sql_order => [ 'foo ASC', 'foo DESC'] });
+  test_order({ order_by => [ qw{ foo bar}   ], expected_sql_order => [ 'foo ASC,bar ASC', 'foo DESC, bar DESC']});
+  test_order({ order_by => { -asc => 'foo'  }, expected_sql_order => [ 'foo ASC', 'foo DESC' ] });
+  test_order({ order_by => { -desc => 'foo' }, expected_sql_order => [ 'foo DESC', 'foo ASC' ] });
+
+  test_order({ order_by => ['foo', { -desc => 'bar' } ], expected_sql_order => [ 'foo ASC, bar DESC', 'foo DESC, bar ASC'] });
+  test_order({ order_by => {-asc => [qw{ foo bar }] }, expected_sql_order => ['foo ASC, bar ASC', 'foo DESC, bar DESC' ] });
+  test_order({ order_by =>
+      [
+        { -asc => 'foo' },
+        { -desc => [qw{bar}] },
+        { -asc  => [qw{baz frew}]},
+      ],
+      expected_sql_order => ['foo ASC, bar DESC, baz ASC, frew ASC', 'foo DESC, bar ASC, baz DESC, frew DESC']
+  });

Modified: DBIx-Class/0.08/trunk/t/46where_attribute.t
===================================================================
--- DBIx-Class/0.08/trunk/t/46where_attribute.t	2009-05-24 12:12:39 UTC (rev 6398)
+++ DBIx-Class/0.08/trunk/t/46where_attribute.t	2009-05-24 13:00:50 UTC (rev 6399)
@@ -1,74 +1,74 @@
-use strict;
-use warnings;
-
-use Test::More;
-use Data::Dumper;
-use lib qw(t/lib);
-use DBICTest;
-my $schema = DBICTest->init_schema();
-
-plan tests => 16;
-
-# select from a class with resultset_attributes
-my $resultset = $schema->resultset('BooksInLibrary');
-is($resultset, 3, "select from a class with resultset_attributes okay");
-
-# now test out selects through a resultset
-my $owner = $schema->resultset('Owners')->find({name => "Newton"});
-my $programming_perl = $owner->books->find_or_create({ title => "Programming Perl" });
-is($programming_perl->id, 1, 'select from a resultset with find_or_create for existing entry ok');
-
-# and inserts?
-my $see_spot;
-$see_spot = eval { $owner->books->find_or_create({ title => "See Spot Run" }) };
-if ($@) { print $@ }
-ok(!$@, 'find_or_create on resultset with attribute for non-existent entry did not throw');
-ok(defined $see_spot, 'successfully did insert on resultset with attribute for non-existent entry');
-
-my $see_spot_rs = $owner->books->search({ title => "See Spot Run" });
-eval { $see_spot_rs->delete(); };
-if ($@) { print $@ }
-ok(!$@, 'delete on resultset with attribute did not throw');
-is($see_spot_rs->count(), 0, 'delete on resultset with attributes succeeded');
-
-# many_to_many tests
-my $collection = $schema->resultset('Collection')->search({collectionid => 1});
-my $pointy_objects = $collection->search_related('collection_object')->search_related('object', { type => "pointy"});
-my $pointy_count = $pointy_objects->count();
-is($pointy_count, 2, 'many_to_many explicit query through linking table with query starting from resultset count correct');
-
-$collection = $schema->resultset('Collection')->find(1);
-$pointy_objects = $collection->search_related('collection_object')->search_related('object', { type => "pointy"});
-$pointy_count = $pointy_objects->count();
-is($pointy_count, 2, 'many_to_many explicit query through linking table with query starting from row count correct');
-
-# use where on many_to_many query
-$collection = $schema->resultset('Collection')->find(1);
-$pointy_objects = $collection->search_related('collection_object')->search_related('object', {}, { where => { 'object.type' => 'pointy' } });
-is($pointy_objects->count(), 2, 'many_to_many explicit query through linking table with where starting from row count correct');
-
-$collection = $schema->resultset('Collection')->find(1);
-$pointy_objects = $collection->pointy_objects();
-$pointy_count = $pointy_objects->count();
-is($pointy_count, 2, 'many_to_many resultset with where in resultset attrs count correct');
-
-# add_to_$rel on many_to_many with where containing a required field
-eval {$collection->add_to_pointy_objects({ value => "Nail" }) };
-if ($@) { print $@ }
-ok( !$@, 'many_to_many add_to_$rel($hash) with where in relationship attrs did not throw');
-is($pointy_objects->count, $pointy_count+1, 'many_to_many add_to_$rel($hash) with where in relationship attrs count correct');
-$pointy_count = $pointy_objects->count();
-
-my $pen = $schema->resultset('TypedObject')->create({ value => "Pen", type => "pointy"});
-eval {$collection->add_to_pointy_objects($pen)};
-if ($@) { print $@ }
-ok( !$@, 'many_to_many add_to_$rel($object) with where in relationship attrs did not throw');
-is($pointy_objects->count, $pointy_count+1, 'many_to_many add_to_$rel($object) with where in relationship attrs count correct');
-$pointy_count = $pointy_objects->count();
-
-my $round_objects = $collection->round_objects();
-my $round_count = $round_objects->count();
-eval {$collection->add_to_objects({ value => "Wheel", type => "round" })};
-if ($@) { print $@ }
-ok( !$@, 'many_to_many add_to_$rel($hash) did not throw');
-is($round_objects->count, $round_count+1, 'many_to_many add_to_$rel($hash) count correct');
+use strict;
+use warnings;
+
+use Test::More;
+use Data::Dumper;
+use lib qw(t/lib);
+use DBICTest;
+my $schema = DBICTest->init_schema();
+
+plan tests => 16;
+
+# select from a class with resultset_attributes
+my $resultset = $schema->resultset('BooksInLibrary');
+is($resultset, 3, "select from a class with resultset_attributes okay");
+
+# now test out selects through a resultset
+my $owner = $schema->resultset('Owners')->find({name => "Newton"});
+my $programming_perl = $owner->books->find_or_create({ title => "Programming Perl" });
+is($programming_perl->id, 1, 'select from a resultset with find_or_create for existing entry ok');
+
+# and inserts?
+my $see_spot;
+$see_spot = eval { $owner->books->find_or_create({ title => "See Spot Run" }) };
+if ($@) { print $@ }
+ok(!$@, 'find_or_create on resultset with attribute for non-existent entry did not throw');
+ok(defined $see_spot, 'successfully did insert on resultset with attribute for non-existent entry');
+
+my $see_spot_rs = $owner->books->search({ title => "See Spot Run" });
+eval { $see_spot_rs->delete(); };
+if ($@) { print $@ }
+ok(!$@, 'delete on resultset with attribute did not throw');
+is($see_spot_rs->count(), 0, 'delete on resultset with attributes succeeded');
+
+# many_to_many tests
+my $collection = $schema->resultset('Collection')->search({collectionid => 1});
+my $pointy_objects = $collection->search_related('collection_object')->search_related('object', { type => "pointy"});
+my $pointy_count = $pointy_objects->count();
+is($pointy_count, 2, 'many_to_many explicit query through linking table with query starting from resultset count correct');
+
+$collection = $schema->resultset('Collection')->find(1);
+$pointy_objects = $collection->search_related('collection_object')->search_related('object', { type => "pointy"});
+$pointy_count = $pointy_objects->count();
+is($pointy_count, 2, 'many_to_many explicit query through linking table with query starting from row count correct');
+
+# use where on many_to_many query
+$collection = $schema->resultset('Collection')->find(1);
+$pointy_objects = $collection->search_related('collection_object')->search_related('object', {}, { where => { 'object.type' => 'pointy' } });
+is($pointy_objects->count(), 2, 'many_to_many explicit query through linking table with where starting from row count correct');
+
+$collection = $schema->resultset('Collection')->find(1);
+$pointy_objects = $collection->pointy_objects();
+$pointy_count = $pointy_objects->count();
+is($pointy_count, 2, 'many_to_many resultset with where in resultset attrs count correct');
+
+# add_to_$rel on many_to_many with where containing a required field
+eval {$collection->add_to_pointy_objects({ value => "Nail" }) };
+if ($@) { print $@ }
+ok( !$@, 'many_to_many add_to_$rel($hash) with where in relationship attrs did not throw');
+is($pointy_objects->count, $pointy_count+1, 'many_to_many add_to_$rel($hash) with where in relationship attrs count correct');
+$pointy_count = $pointy_objects->count();
+
+my $pen = $schema->resultset('TypedObject')->create({ value => "Pen", type => "pointy"});
+eval {$collection->add_to_pointy_objects($pen)};
+if ($@) { print $@ }
+ok( !$@, 'many_to_many add_to_$rel($object) with where in relationship attrs did not throw');
+is($pointy_objects->count, $pointy_count+1, 'many_to_many add_to_$rel($object) with where in relationship attrs count correct');
+$pointy_count = $pointy_objects->count();
+
+my $round_objects = $collection->round_objects();
+my $round_count = $round_objects->count();
+eval {$collection->add_to_objects({ value => "Wheel", type => "round" })};
+if ($@) { print $@ }
+ok( !$@, 'many_to_many add_to_$rel($hash) did not throw');
+is($round_objects->count, $round_count+1, 'many_to_many add_to_$rel($hash) count correct');

Modified: DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/BooksInLibrary.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/BooksInLibrary.pm	2009-05-24 12:12:39 UTC (rev 6398)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/BooksInLibrary.pm	2009-05-24 13:00:50 UTC (rev 6399)
@@ -1,32 +1,32 @@
-package # hide from PAUSE 
-    DBICTest::Schema::BooksInLibrary;
-
-use base qw/DBICTest::BaseResult/;
-
-__PACKAGE__->table('books');
-__PACKAGE__->add_columns(
-  'id' => {
-    data_type => 'integer',
-    is_auto_increment => 1,
-  },
-  'source' => {
-    data_type => 'varchar',
-    size      => '100',
-  },
-  'owner' => {
-    data_type => 'integer',
-  },
-  'title' => {
-    data_type => 'varchar',
-    size      => '100',
-  },
-  'price' => {
-    data_type => 'integer',
-    is_nullable => 1,
-  },
-);
-__PACKAGE__->set_primary_key('id');
-
-__PACKAGE__->resultset_attributes({where => { source => "Library" } });
-
-1;
+package # hide from PAUSE 
+    DBICTest::Schema::BooksInLibrary;
+
+use base qw/DBICTest::BaseResult/;
+
+__PACKAGE__->table('books');
+__PACKAGE__->add_columns(
+  'id' => {
+    data_type => 'integer',
+    is_auto_increment => 1,
+  },
+  'source' => {
+    data_type => 'varchar',
+    size      => '100',
+  },
+  'owner' => {
+    data_type => 'integer',
+  },
+  'title' => {
+    data_type => 'varchar',
+    size      => '100',
+  },
+  'price' => {
+    data_type => 'integer',
+    is_nullable => 1,
+  },
+);
+__PACKAGE__->set_primary_key('id');
+
+__PACKAGE__->resultset_attributes({where => { source => "Library" } });
+
+1;

Modified: DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Collection.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Collection.pm	2009-05-24 12:12:39 UTC (rev 6398)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Collection.pm	2009-05-24 13:00:50 UTC (rev 6399)
@@ -1,30 +1,30 @@
-package # hide from PAUSE 
-    DBICTest::Schema::Collection;
-
-use base qw/DBICTest::BaseResult/;
-
-__PACKAGE__->table('collection');
-__PACKAGE__->add_columns(
-  'collectionid' => {
-    data_type => 'integer',
-    is_auto_increment => 1,
-  },
-  'name' => {
-    data_type => 'varchar',
-    size      => 100,
-  },
-);
-__PACKAGE__->set_primary_key('collectionid');
-
-__PACKAGE__->has_many( collection_object => "DBICTest::Schema::CollectionObject",
-                       { "foreign.collection" => "self.collectionid" }
-                     );
-__PACKAGE__->many_to_many( objects => collection_object => "object" );
-__PACKAGE__->many_to_many( pointy_objects => collection_object => "object",
-                           { where => { "object.type" => "pointy" } }
-                         );
-__PACKAGE__->many_to_many( round_objects => collection_object => "object",
-                           { where => { "object.type" => "round" } } 
-                         );
-
-1;
+package # hide from PAUSE 
+    DBICTest::Schema::Collection;
+
+use base qw/DBICTest::BaseResult/;
+
+__PACKAGE__->table('collection');
+__PACKAGE__->add_columns(
+  'collectionid' => {
+    data_type => 'integer',
+    is_auto_increment => 1,
+  },
+  'name' => {
+    data_type => 'varchar',
+    size      => 100,
+  },
+);
+__PACKAGE__->set_primary_key('collectionid');
+
+__PACKAGE__->has_many( collection_object => "DBICTest::Schema::CollectionObject",
+                       { "foreign.collection" => "self.collectionid" }
+                     );
+__PACKAGE__->many_to_many( objects => collection_object => "object" );
+__PACKAGE__->many_to_many( pointy_objects => collection_object => "object",
+                           { where => { "object.type" => "pointy" } }
+                         );
+__PACKAGE__->many_to_many( round_objects => collection_object => "object",
+                           { where => { "object.type" => "round" } } 
+                         );
+
+1;

Modified: DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/CollectionObject.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/CollectionObject.pm	2009-05-24 12:12:39 UTC (rev 6398)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/CollectionObject.pm	2009-05-24 13:00:50 UTC (rev 6399)
@@ -1,24 +1,24 @@
-package # hide from PAUSE 
-    DBICTest::Schema::CollectionObject;
-
-use base qw/DBICTest::BaseResult/;
-
-__PACKAGE__->table('collection_object');
-__PACKAGE__->add_columns(
-  'collection' => {
-    data_type => 'integer',
-  },
-  'object' => {
-    data_type => 'integer',
-  },
-);
-__PACKAGE__->set_primary_key(qw/collection object/);
-
-__PACKAGE__->belongs_to( collection => "DBICTest::Schema::Collection",
-                         { "foreign.collectionid" => "self.collection" }
-                       );
-__PACKAGE__->belongs_to( object => "DBICTest::Schema::TypedObject",
-                         { "foreign.objectid" => "self.object" }
-                       );
-
-1;
+package # hide from PAUSE 
+    DBICTest::Schema::CollectionObject;
+
+use base qw/DBICTest::BaseResult/;
+
+__PACKAGE__->table('collection_object');
+__PACKAGE__->add_columns(
+  'collection' => {
+    data_type => 'integer',
+  },
+  'object' => {
+    data_type => 'integer',
+  },
+);
+__PACKAGE__->set_primary_key(qw/collection object/);
+
+__PACKAGE__->belongs_to( collection => "DBICTest::Schema::Collection",
+                         { "foreign.collectionid" => "self.collection" }
+                       );
+__PACKAGE__->belongs_to( object => "DBICTest::Schema::TypedObject",
+                         { "foreign.objectid" => "self.object" }
+                       );
+
+1;

Modified: DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Owners.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Owners.pm	2009-05-24 12:12:39 UTC (rev 6398)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Owners.pm	2009-05-24 13:00:50 UTC (rev 6399)
@@ -1,21 +1,21 @@
-package # hide from PAUSE 
-    DBICTest::Schema::Owners;
-
-use base qw/DBICTest::BaseResult/;
-
-__PACKAGE__->table('owners');
-__PACKAGE__->add_columns(
-  'ownerid' => {
-    data_type => 'integer',
-    is_auto_increment => 1,
-  },
-  'name' => {
-    data_type => 'varchar',
-    size      => '100',
-  },
-);
-__PACKAGE__->set_primary_key('ownerid');
-
-__PACKAGE__->has_many(books => "DBICTest::Schema::BooksInLibrary", "owner");
-
-1;
+package # hide from PAUSE 
+    DBICTest::Schema::Owners;
+
+use base qw/DBICTest::BaseResult/;
+
+__PACKAGE__->table('owners');
+__PACKAGE__->add_columns(
+  'ownerid' => {
+    data_type => 'integer',
+    is_auto_increment => 1,
+  },
+  'name' => {
+    data_type => 'varchar',
+    size      => '100',
+  },
+);
+__PACKAGE__->set_primary_key('ownerid');
+
+__PACKAGE__->has_many(books => "DBICTest::Schema::BooksInLibrary", "owner");
+
+1;

Modified: DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/SelfRef.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/SelfRef.pm	2009-05-24 12:12:39 UTC (rev 6398)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/SelfRef.pm	2009-05-24 13:00:50 UTC (rev 6399)
@@ -1,21 +1,21 @@
-package # hide from PAUSE 
-    DBICTest::Schema::SelfRef;
-
-use base qw/DBICTest::BaseResult/;
-
-__PACKAGE__->table('self_ref');
-__PACKAGE__->add_columns(
-  'id' => {
-    data_type => 'integer',
-    is_auto_increment => 1,
-  },
-  'name' => {
-    data_type => 'varchar',
-    size      => 100,
-  },
-);
-__PACKAGE__->set_primary_key('id');
-
-__PACKAGE__->has_many( aliases => 'DBICTest::Schema::SelfRefAlias' => 'self_ref' );
-
-1;
+package # hide from PAUSE 
+    DBICTest::Schema::SelfRef;
+
+use base qw/DBICTest::BaseResult/;
+
+__PACKAGE__->table('self_ref');
+__PACKAGE__->add_columns(
+  'id' => {
+    data_type => 'integer',
+    is_auto_increment => 1,
+  },
+  'name' => {
+    data_type => 'varchar',
+    size      => 100,
+  },
+);
+__PACKAGE__->set_primary_key('id');
+
+__PACKAGE__->has_many( aliases => 'DBICTest::Schema::SelfRefAlias' => 'self_ref' );
+
+1;

Modified: DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/SelfRefAlias.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/SelfRefAlias.pm	2009-05-24 12:12:39 UTC (rev 6398)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/SelfRefAlias.pm	2009-05-24 13:00:50 UTC (rev 6399)
@@ -1,20 +1,20 @@
-package # hide from PAUSE 
-    DBICTest::Schema::SelfRefAlias;
-
-use base qw/DBICTest::BaseResult/;
-
-__PACKAGE__->table('self_ref_alias');
-__PACKAGE__->add_columns(
-  'self_ref' => {
-    data_type => 'integer',
-  },
-  'alias' => {
-    data_type => 'integer',
-  },
-);
-__PACKAGE__->set_primary_key(qw/self_ref alias/);
-
-__PACKAGE__->belongs_to( self_ref => 'DBICTest::Schema::SelfRef' );
-__PACKAGE__->belongs_to( alias => 'DBICTest::Schema::SelfRef' );
-
-1;
+package # hide from PAUSE 
+    DBICTest::Schema::SelfRefAlias;
+
+use base qw/DBICTest::BaseResult/;
+
+__PACKAGE__->table('self_ref_alias');
+__PACKAGE__->add_columns(
+  'self_ref' => {
+    data_type => 'integer',
+  },
+  'alias' => {
+    data_type => 'integer',
+  },
+);
+__PACKAGE__->set_primary_key(qw/self_ref alias/);
+
+__PACKAGE__->belongs_to( self_ref => 'DBICTest::Schema::SelfRef' );
+__PACKAGE__->belongs_to( alias => 'DBICTest::Schema::SelfRef' );
+
+1;




More information about the Bast-commits mailing list