From: David Kamholz Date: Sun, 16 Oct 2005 00:41:26 +0000 (+0000) Subject: add eval "require $f_class" to HasOne.pm -- otherwise it can fail when the class... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=36e58b241cab56b1c2daaf51ad0219f2129c638c;p=dbsrgits%2FDBIx-Class-Historic.git add eval "require $f_class" to HasOne.pm -- otherwise it can fail when the class hasn't been loaded (and load order isn't always controllable, e.g. with Catalyst) --- 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" )