From 5ea3b0ea916b1c1d37b94be3e0522938ccc4dae6 Mon Sep 17 00:00:00 2001
From: Peter Rabbitson <ribasushi@cpan.org>
Date: Fri, 13 Mar 2015 13:43:08 +0100
Subject: [PATCH 1/5] Relax sanity check in _resolve_relationship_condition

This woud be a clear regression for a broad range of downstream Apps
compared to the behavior of 0.08196

It doesn't buy much and breaks legitimate class redirection techniques
(some of them even documented in the cookbook)

(cherry pick of 7411a51d)
---
 Changes                        | 5 +++++
 lib/DBIx/Class/ResultSource.pm | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

--- a/Changes
+++ b/Changes
@@ -1,5 +1,10 @@
 Revision history for DBIx::Class
 
+    * Fixes
+        - Relax the 'self_result_object' argument check in the relationship
+          resolution codepath, restoring exotic uses of inflate_result
+          http://lists.scsys.co.uk/pipermail/dbix-class/2015-January/011876.html
+
 0.082810 2014-10-25 13:58 (UTC)
     * Fixes
         - Fix incorrect collapsing-parser source being generated in the
--- a/lib/DBIx/Class/ResultSource.pm
+++ b/lib/DBIx/Class/ResultSource.pm
@@ -1904,11 +1904,11 @@
 
   $args->{condition} ||= $rel_info->{cond};
 
-  $self->throw_exception( "Argument 'self_result_object' must be an object of class '@{[ $self->result_class ]}'" )
+  $self->throw_exception( "Argument 'self_result_object' must be an object inheriting from DBIx::Class::Row" )
     if (
       exists $args->{self_result_object}
         and
-      ( ! defined blessed $args->{self_result_object} or ! $args->{self_result_object}->isa($self->result_class) )
+      ( ! defined blessed $args->{self_result_object} or ! $args->{self_result_object}->isa('DBIx::Class::Row') )
     )
   ;
 
