if ('HASH' eq ref $value) {
my ($query, $more_objects) = _pre_parse($value, $with_objects, _prefix($prefix, $key));
push @result, @$query if $query;
- push @$with_objects, $key, ($more_objects ? @$more_objects : ());
+ push @$with_objects, _prefix($prefix, $key), ($more_objects ? @$more_objects : ());
} else {
push @result, _prefix($prefix, $key) => $value;
}
}
}, {
query => [ 'customer.chart.accno' => 'test' ],
- with_objects => bag( 'customer', 'chart' ),
+ with_objects => bag( 'customer', 'customer.chart' ),
}, 'nested joins';
test {
},
{
query => [ 'customer.chart.accno' => { like => '%1200' } ],
- with_objects => bag('customer', 'chart' ),
+ with_objects => bag('customer', 'customer.chart' ),
}, 'all together';
'invoice.customer.name' => 'test',
'customer.name' => 'test',
}} ],
- 'with_objects' => bag( 'invoice', 'customer' )
+ 'with_objects' => bag( 'invoice.customer', 'customer', 'invoice' )
}, 'object in more than one relationship';
test {
}
}, 'deep laundering, check for laundered hash', target => 'launder', launder_to => { };
+### bug: sub objects
+
+test {
+ order => {
+ customer => {
+ 'name:substr::ilike' => 'test',
+ }
+ }
+}, {
+ query => [ 'order.customer.name' => { ilike => '%test%' } ],
+ with_objects => bag('order.customer', 'order'),
+}, 'sub objects have to retain their prefix';
+