fix result_class setter behaviour to not stuff attrs (line commented out to prevent...
Matt S Trout [Thu, 20 May 2010 17:36:01 +0000 (17:36 +0000)]
Changes
lib/DBIx/Class/ResultSet.pm

diff --git a/Changes b/Changes
index 120be79..17eea21 100644 (file)
--- 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
index 4343a4f..4e06ed6 100644 (file)
@@ -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;
 }