Updated version and Changes for 0.06999_02
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Relationship / HasOne.pm
index 682d150..aa94a08 100644 (file)
@@ -1,4 +1,5 @@
-package DBIx::Class::Relationship::HasOne;
+package # hide from PAUSE
+    DBIx::Class::Relationship::HasOne;
 
 use strict;
 use warnings;
@@ -13,11 +14,7 @@ sub has_one {
 
 sub _has_one {
   my ($class, $join_type, $rel, $f_class, $cond, $attrs) = @_;
-  eval "require $f_class";
-  if ($@) {
-    $class->throw_exception($@) unless $@ =~ /Can't locate/;
-  }
-
+  $class->ensure_class_loaded($f_class);
   unless (ref $cond) {
     my ($pri, $too_many) = $class->primary_columns;
     $class->throw_exception( "might_have/has_one can only infer join for a single primary key; ${class} has more" )