X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FCDBICompat%2FRelationships.pm;fp=lib%2FDBIx%2FClass%2FCDBICompat%2FRelationships.pm;h=7b08d07d9ade09bd7193523a6e190f7ed2110700;hp=f3c0c9c7a63a850d8b25e4406135917403373511;hb=eab44f5277e5f7f479528b80beba4c306e75af54;hpb=02562a2092543488bba4ccd98c39abca72560555 diff --git a/lib/DBIx/Class/CDBICompat/Relationships.pm b/lib/DBIx/Class/CDBICompat/Relationships.pm index f3c0c9c..7b08d07 100644 --- a/lib/DBIx/Class/CDBICompat/Relationships.pm +++ b/lib/DBIx/Class/CDBICompat/Relationships.pm @@ -218,7 +218,10 @@ sub search { } sub new_related { - return shift->search_related(shift)->new_result(@_); + $_[0]->throw_exception("Calling new_related() as a class method is not supported") + unless length ref $_[0]; + + shift->next::method(@_); } =head1 FURTHER QUESTIONS?