don't try and ensure_class_loaded an object. this doesn't work.
Matt S Trout [Thu, 20 May 2010 17:19:14 +0000 (17:19 +0000)]
lib/DBIx/Class/ResultSet.pm

index 1dc4068..4343a4f 100644 (file)
@@ -1138,7 +1138,9 @@ in the original source class will not run.
 sub result_class {
   my ($self, $result_class) = @_;
   if ($result_class) {
-    $self->ensure_class_loaded($result_class);
+    unless (ref $result_class) { # don't fire this for an object
+      $self->ensure_class_loaded($result_class);
+    }
     $self->_result_class($result_class);
     $self->{attrs}{result_class} = $result_class if ref $self;
   }