$attrs->{alias} ||= 'me';
- # Creation of {} and bless separated to mitigate RH perl bug
- # see https://bugzilla.redhat.com/show_bug.cgi?id=196836
- my $self = {
+ my $self = bless {
result_source => $source,
cond => $attrs->{where},
pager => undef,
attrs => $attrs,
- };
-
- bless $self, $class;
+ }, $class;
$self->result_class(
$attrs->{result_class} || $source->result_class
);
- return $self;
+ $self;
}
=head2 search
return $fresh_rs->search( {}, {
from => [{
$attrs->{alias} => $self->as_query,
- -alias => $attrs->{alias},
- -source_handle => $self->result_source->handle,
+ -alias => $attrs->{alias},
+ -rsrc => $self->result_source,
}],
alias => $attrs->{alias},
});
);
$from = [{
- -source_handle => $source->handle,
- -alias => $attrs->{alias},
+ -rsrc => $source,
+ -alias => $attrs->{alias},
$attrs->{alias} => $rs_copy->as_query,
}];
delete @{$attrs}{@force_subq_attrs, qw/where bind/};
}
else {
$from = [{
- -source_handle => $source->handle,
+ -rsrc => $source,
-alias => $attrs->{alias},
$attrs->{alias} => $source->from,
}];
$attrs->{as} = \@as;
$attrs->{from} ||= [{
- -source_handle => $source->handle,
- -alias => $self->{attrs}{alias},
+ -rsrc => $source,
+ -alias => $self->{attrs}{alias},
$self->{attrs}{alias} => $source->from,
}];
# A cursor in progress can't be serialized (and would make little sense anyway)
delete $to_serialize->{cursor};
- return nfreeze($to_serialize);
+ nfreeze($to_serialize);
}
# need this hook for symmetry
%$self = %{ thaw($serialized) };
- return $self;
+ $self;
}