From: David Kamholz Date: Wed, 22 Nov 2006 22:44:22 +0000 (+0000) Subject: fix typo fix X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=61354236cfa5c2c20ce8b5bf5794b3a98c63da48;p=dbsrgits%2FDBIx-Class-Historic.git fix typo fix --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 9928344..1ace329 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -1258,11 +1258,9 @@ sub new_result { my %new = ( %{ $self->_remove_alias($values, $alias) }, %{ $self->_remove_alias($collapsed_cond, $alias) }, - _source_handle => $self->_source_handle, ); - my $obj = $self->result_class->new(\%new); - return $obj; + return $self->result_class->new(\%new,$self->_source_handle); } # _collapse_cond diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index 6cee23f..c4cfadc 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -30,7 +30,7 @@ Creates a new row object from column => value mappings passed as a hash ref =cut sub new { - my ($class, $attrs) = @_; + my ($class, $attrs, $source) = @_; $class = ref $class if ref $class; my $new = { _column_data => {} }; @@ -39,9 +39,7 @@ sub new { if ($attrs) { $new->throw_exception("attrs must be a hashref") unless ref($attrs) eq 'HASH'; - if (my $source = delete $attrs->{-source_handle}) { - $new->_source_handle($source); - } + foreach my $k (keys %$attrs) { $new->throw_exception("No such column $k on $class") unless $class->has_column($k); @@ -49,6 +47,8 @@ sub new { } } + $new->_source_handle($source) if $source; + return $new; }