X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FRelationship%2FHasOne.pm;h=584ed2a272b55c362270ccefb4fe39004427ef55;hb=5a3c5f6456be8132194dfbb8012da6bcc65acd67;hp=f3521e671478cbb5ba979c0850f8452b60f0c659;hpb=99be059e6d635374f075f430af6e7cd6ee18ab67;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/Relationship/HasOne.pm b/lib/DBIx/Class/Relationship/HasOne.pm index f3521e6..584ed2a 100644 --- a/lib/DBIx/Class/Relationship/HasOne.pm +++ b/lib/DBIx/Class/Relationship/HasOne.pm @@ -13,6 +13,7 @@ sub has_one { sub _has_one { my ($class, $join_type, $rel, $f_class, $cond, $attrs) = @_; + eval "require $f_class"; unless (ref $cond) { my ($pri, $too_many) = keys %{ $class->_primaries }; $class->throw( "might_have/has_one can only infer join for a single primary key; ${class} has more" )