From: Matt S Trout Date: Wed, 21 Jun 2006 21:05:44 +0000 (+0000) Subject: fix Componentised, Relationship::Base X-Git-Tag: v0.07002~75^2~93^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4d87db01f2e16c82b74bb9681ebd605acd6dbd37;p=dbsrgits%2FDBIx-Class.git fix Componentised, Relationship::Base --- diff --git a/lib/DBIx/Class/Componentised.pm b/lib/DBIx/Class/Componentised.pm index 5841afa..2b3bf83 100644 --- a/lib/DBIx/Class/Componentised.pm +++ b/lib/DBIx/Class/Componentised.pm @@ -6,6 +6,7 @@ use warnings; use Class::C3; use Class::Inspector; +use Carp::Clan qw/DBIx::Class/; sub inject_base { my ($class, $target, @to_inject) = @_; @@ -71,7 +72,13 @@ sub ensure_class_loaded { my ($class, $f_class) = @_; return if Class::Inspector->loaded($f_class); eval "require $f_class"; # require needs a bareword or filename - $class->throw_exception($@) if ($@); + if ($@) { + if ($class->can('throw_exception')) { + $class->throw_exception($@); + } else { + croak $@; + } + } } # Returns true if the specified class is installed or already loaded, false diff --git a/lib/DBIx/Class/Relationship/Base.pm b/lib/DBIx/Class/Relationship/Base.pm index 7bfcd13..3e74d54 100644 --- a/lib/DBIx/Class/Relationship/Base.pm +++ b/lib/DBIx/Class/Relationship/Base.pm @@ -448,9 +448,6 @@ Removes the link between the current object and the related object. Note that the related object itself won't be deleted unless you call ->delete() on it. This method just removes the link between the two objects. - -1; - =head1 AUTHORS Matt S. Trout @@ -461,3 +458,4 @@ You may distribute this code under the same terms as Perl itself. =cut +1;