Skip to content

Commit

Permalink
More fallout of the _resolve_cond refactor 03f6d1f
Browse files Browse the repository at this point in the history
I had in the back of my mind "one can't just create random objects" but
figured it may work anyway - WROOOOOOOONG. Instead pass through the hash
as before, will need to rethink that part before settling on an API for
resolve_relationship_condition. FML
  • Loading branch information
ribasushi committed Jun 13, 2014
1 parent 9a94cf9 commit 5592d63
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions lib/DBIx/Class/ResultSource.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1704,11 +1704,10 @@ sub _resolve_condition {
else {
$res_args[$_] ||= {};

# hate everywhere - have to pass in as a plain hash
# pretending to be an object at least for now
$self->throw_exception("Unsupported object-like structure encountered: $res_args[$_]")
unless ref $res_args[$_] eq 'HASH';

# hate everywhere
$res_args[$_] = $self->relationship_info($rel_name)->{source}->result_class->new($res_args[$_]);
}
}

Expand Down Expand Up @@ -1881,7 +1880,16 @@ sub _resolve_relationship_condition {
;

for my $i (0..$#$obj_cols) {
if (defined $args->{self_resultobj} and ! $obj->has_column_loaded($obj_cols->[$i])) {

# FIXME - temp shim
if (! blessed $obj) {
$cond->{"$plain_alias.$plain_cols->[$i]"} = $obj->{$obj_cols->[$i]};
}
elsif (
defined $args->{self_resultobj}
and
! $obj->has_column_loaded($obj_cols->[$i])
) {

$self->throw_exception(sprintf
"Unable to resolve relationship '%s' from object '%s': column '%s' not "
Expand Down

0 comments on commit 5592d63

Please sign in to comment.