[Dbix-class] Help needed to get a much needed feature into DBIC
(low barrier to entry)
neil.lunn
neil at mylunn.id.au
Fri Jan 10 06:35:25 GMT 2014
On 10/01/2014 5:11 PM, Peter Rabbitson wrote:
> On Fri, Jan 10, 2014 at 04:47:56PM +1100, neil.lunn wrote:
>> On 10/01/2014 3:55 PM, Peter Rabbitson wrote:
>> Current test cases are showing an expected result of : [{ artist => {
>> '-foo' => 1 }}] and getting a result of: [{ artist => [ { '-foo' => [
>> 1 ] } ]}]
> I must be blind - I do not see a test like this. Please tell me which line.
Actually the first test. '-foo' => [ 1 ] appears to be the erroneous
munging of the supplied element into a list.
One more thing just from the last two tests:
{
my $a = [ { 'artist' => 'manager' }, 'cd' ];
my $b = [ 'artist', { 'artist' => 'manager' } ];
my $expected = [ { 'artist' => 'manager' }, 'cd', { 'artist' =>
'manager' } ];
my $result = $rs->_merge_joinpref_attr($a, $b);
is_deeply( $result, $expected );
}
{
my $a = [{ artist => [{ -join_type => 123 }, 'manager' ] }, 'cd' ];
my $b = [{ artist => { -join_type => 123 } }, { artist => [{
-join_type => 123 }, 'manager'] } ];
my $expected = [ { artist => [{ -join_type => 123 }, 'manager'] },
'cd', { artist => [{ -join_type => 123 }, 'manager'] } ];
my $result = $rs->_merge_joinpref_attr($a, $b);
is_deeply( $result, $expected );
}
Assuming the expected is merging *left to right* where the first element
is considered matching the existing key and the following list element
is pushed onto the list. Just trying to word out the algorithm in order
to visualize it.
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
More information about the DBIx-Class
mailing list