Skip to content

Commit

Permalink
Relax sanity check in _resolve_relationship_condition
Browse files Browse the repository at this point in the history
It doesn't buy much and breaks legitimate class redirection techniques
(some of them even documented in the cookbook)
  • Loading branch information
ribasushi committed Mar 13, 2015
1 parent 127fb47 commit 65abdb8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Revision history for DBIx::Class
* Fixes
- Protect destructors from rare but possible double execution, and
loudly warn the user whenever the problem is encountered (GH#63)
- 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
- Fix updating multiple CLOB/BLOB columns on Oracle
- Fix incorrect collapsing-parser source being generated in the
presence of unicode data among the collapse-points
Expand Down
4 changes: 2 additions & 2 deletions lib/DBIx/Class/ResultSource.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1904,11 +1904,11 @@ sub _resolve_relationship_condition {

$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') )
)
;

Expand Down

0 comments on commit 65abdb8

Please sign in to comment.