my $obj_prefix = join '.', @tokens, '';
if ($manager->can('filter')) {
- ($key, $value, my $obj) = $manager->filter($last_token, $value, $obj_prefix);
+ ($key, $value, my $obj) = $manager->filter($last_token, $value, $obj_prefix, $obj_path);
_add_uniq($with_objects, $obj) if $obj;
} else {
_add_uniq($with_objects, $obj_path) if $obj_path;
my %filter_spec;
sub filter {
- my ($class, $key, $value, $prefix) = @_;
+ my ($class, $key, $value, $prefix, $path) = @_;
my $filters = _get_filters($class);
- return ($prefix . $key, $value) unless $filters->{$key};
+ return ($prefix . $key, $value, $path) unless $filters->{$key};
return $filters->{$key}->($key, $value, $prefix);
}
'part.partnumber', {
ilike => '%1%'
}
- ]
+ ],
+ with_objects => [ 'part' ],
}, 'Regression check: prefixing of fallback filtering in relation with custom filters', class => 'SL::DB::Manager::OrderItem';
test {
'description:substr:multi::ilike' => 'term1 term2',