From: Matt S Trout Date: Thu, 20 May 2010 17:36:01 +0000 (+0000) Subject: fix result_class setter behaviour to not stuff attrs (line commented out to prevent... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f50497ab497520c6f79154cdff283921c4d2cb9e;p=dbsrgits%2FDBIx-Class-Historic.git fix result_class setter behaviour to not stuff attrs (line commented out to prevent this regression being mistakenly re-introduced) --- diff --git a/Changes b/Changes index 120be79..17eea21 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ Revision history for DBIx::Class + - Fix result_class setter behaviour to not mistakenly stuff attrs. + - Don't try and ensure_class_loaded an object. This doesn't work. - Add a warning to load_namespaces if a class in ResultSet/ is not a subclass of DBIx::Class::ResultSet - ::Storage::DBI now correctly preserves a parent $dbh from diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 4343a4f..4e06ed6 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -1142,7 +1142,10 @@ sub result_class { $self->ensure_class_loaded($result_class); } $self->_result_class($result_class); - $self->{attrs}{result_class} = $result_class if ref $self; + # THIS LINE WOULD BE A BUG - this accessor specifically exists to + # permit the user to set result class on one result set only; it only + # chains if provided to search() + #$self->{attrs}{result_class} = $result_class if ref $self; } $self->_result_class; }