[Bast-commits] r8996 - in DBIx-Class/0.08/trunk: lib/DBIx/Class
lib/DBIx/Class/CDBICompat t t/lib/DBICTest/Schema t/ordered t/row
mo at dev.catalyst.perl.org
mo at dev.catalyst.perl.org
Sat Mar 13 12:37:40 GMT 2010
Author: mo
Date: 2010-03-13 12:37:40 +0000 (Sat, 13 Mar 2010)
New Revision: 8996
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat/LiveObjectIndex.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSet.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/Row.pm
DBIx-Class/0.08/trunk/t/93single_accessor_object.t
DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/EventTZPg.pm
DBIx-Class/0.08/trunk/t/ordered/cascade_delete.t
DBIx-Class/0.08/trunk/t/row/inflate_result.t
Log:
reverting 8995, was supposed to go to a branch
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat/LiveObjectIndex.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat/LiveObjectIndex.pm 2010-03-13 12:09:59 UTC (rev 8995)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat/LiveObjectIndex.pm 2010-03-13 12:37:40 UTC (rev 8996)
@@ -73,11 +73,8 @@
sub inflate_result {
my ($class, @rest) = @_;
-
- # we don't want to inflate_result on new_result
- return $rest[3] if(defined $rest[3] && Scalar::Util::blessed $rest[3]);
-
my $new = $class->next::method(@rest);
+
return $new if $new->nocache;
if (my $key = $new->ID) {
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSet.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSet.pm 2010-03-13 12:09:59 UTC (rev 8995)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSet.pm 2010-03-13 12:37:40 UTC (rev 8996)
@@ -1859,9 +1859,8 @@
-source_handle => $self->_source_handle,
-result_source => $self->result_source, # DO NOT REMOVE THIS, REQUIRED
);
- my $row = $self->result_class->new(\%new);
- #return $row;
- return $self->result_class->inflate_result($self->result_source, $row->{_column_data}, undef, $row);
+
+ return $self->result_class->new(\%new);
}
# _merge_cond_with_data
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Row.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Row.pm 2010-03-13 12:09:59 UTC (rev 8995)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Row.pm 2010-03-13 12:37:40 UTC (rev 8996)
@@ -1067,7 +1067,7 @@
=over
-=item Arguments: $result_source, \%columndata, \%prefetcheddata, [$row]
+=item Arguments: $result_source, \%columndata, \%prefetcheddata
=item Returns: A Row object
@@ -1088,9 +1088,8 @@
=cut
sub inflate_result {
- my ($class, $source, $me, $prefetch, $row) = @_;
- return $row if (defined $row && (Scalar::Util::blessed $row));
-
+ my ($class, $source, $me, $prefetch) = @_;
+
my ($source_handle) = $source;
if ($source->isa('DBIx::Class::ResultSourceHandle')) {
Modified: DBIx-Class/0.08/trunk/t/93single_accessor_object.t
===================================================================
--- DBIx-Class/0.08/trunk/t/93single_accessor_object.t 2010-03-13 12:09:59 UTC (rev 8995)
+++ DBIx-Class/0.08/trunk/t/93single_accessor_object.t 2010-03-13 12:37:40 UTC (rev 8996)
@@ -45,20 +45,20 @@
$schema = DBICTest->init_schema();
{
- my $artist = $schema->resultset('Artist')->create({ artistid => 666, name => 'bad religion' });
- my $cd = $schema->resultset('CD')->create({ cdid => 187, artist => 1, title => 'how could hell be any worse?', year => 1982, genreid => undef });
+ my $artist = $schema->resultset('Artist')->create({ artistid => 666, name => 'bad religion' });
+ my $cd = $schema->resultset('CD')->create({ cdid => 187, artist => 1, title => 'how could hell be any worse?', year => 1982, genreid => undef });
- ok(!defined($cd->get_column('genreid')), 'genreid is NULL'); #no accessor was defined for this column
- ok(!defined($cd->genre), 'genre accessor returns undef');
+ ok(!defined($cd->get_column('genreid')), 'genreid is NULL'); #no accessor was defined for this column
+ ok(!defined($cd->genre), 'genre accessor returns undef');
}
$schema = DBICTest->init_schema();
{
- my $artist = $schema->resultset('Artist')->create({ artistid => 666, name => 'bad religion' });
- my $genre = $schema->resultset('Genre')->create({ genreid => 88, name => 'disco' });
- my $cd = $schema->resultset('CD')->create({ cdid => 187, artist => 1, title => 'how could hell be any worse?', year => 1982 });
+ my $artist = $schema->resultset('Artist')->create({ artistid => 666, name => 'bad religion' });
+ my $genre = $schema->resultset('Genre')->create({ genreid => 88, name => 'disco' });
+ my $cd = $schema->resultset('CD')->create({ cdid => 187, artist => 1, title => 'how could hell be any worse?', year => 1982 });
- dies_ok { $cd->genre } 'genre accessor throws without column';
+ dies_ok { $cd->genre } 'genre accessor throws without column';
}
Property changes on: DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/EventTZPg.pm
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: DBIx-Class/0.08/trunk/t/ordered/cascade_delete.t
___________________________________________________________________
Deleted: svn:mergeinfo
-
Modified: DBIx-Class/0.08/trunk/t/row/inflate_result.t
===================================================================
--- DBIx-Class/0.08/trunk/t/row/inflate_result.t 2010-03-13 12:09:59 UTC (rev 8995)
+++ DBIx-Class/0.08/trunk/t/row/inflate_result.t 2010-03-13 12:37:40 UTC (rev 8996)
@@ -2,7 +2,6 @@
use strict;
use warnings;
-use DBIx::Class::ResultClass::HashRefInflator;
use base qw/DBIx::Class::Core/;
### Define what our admin class is, for ensure_class_loaded()
@@ -21,7 +20,6 @@
sub inflate_result {
my $self = shift;
my $ret = $self->next::method(@_);
-
if ( $ret->admin ) { ### If this is an admin, rebless for extra functions
$self->ensure_class_loaded($admin_class);
bless $ret, $admin_class;
@@ -63,7 +61,6 @@
use lib qw(t/lib);
use DBICTest;
-use DBIx::Class::ResultClass::HashRefInflator;
use Test::More;
@@ -87,12 +84,10 @@
)
);
-my $rs = $schema->resultset('User');
-
TODO: {
local $TODO = 'New objects should also be inflated';
- my $user = $rs->create($user_data);
- my $admin = $rs->create($admin_data);
+ my $user = $schema->resultset('User')->create($user_data);
+ my $admin = $schema->resultset('User')->create($admin_data);
is( ref $user, 'My::Schema::Result::User' );
is( ref $admin, 'My::Schema::Result::User::Admin' );
More information about the Bast-commits
mailing list