Move -result_source handling further up
Ash Berlin [Tue, 8 May 2007 19:41:38 +0000 (19:41 +0000)]
lib/DBIx/Class/Row.pm

index ad463eb..66c6cfb 100644 (file)
@@ -39,6 +39,9 @@ sub new {
   if (my $handle = delete $attrs->{-source_handle}) {
     $new->_source_handle($handle);
   }
+  if (my $source = delete $attrs->{-result_source}) {
+    $new->result_source($source);
+  }
 
   if ($attrs) {
     $new->throw_exception("attrs must be a hashref")
@@ -66,9 +69,6 @@ sub new {
         unless $class->has_column($key);
       $new->store_column($key => $attrs->{$key});          
     }
-    if (my $source = delete $attrs->{-result_source}) {
-      $new->result_source($source);
-    }
 
     $new->{_relationship_data} = $related if $related;
     $new->{_inflated_column} = $inflated if $inflated;