Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 39556a0d

Von Sven Schöling vor fast 13 Jahren hinzugefügt

Bei tiefen parse_filters with_objects mit prefix bauen.

Unterschiede anzeigen:

SL/Controller/Helper/ParseFilter.pm
74 74
    if ('HASH' eq ref $value) {
75 75
      my ($query, $more_objects) = _pre_parse($value, $with_objects, _prefix($prefix, $key));
76 76
      push @result,        @$query if $query;
77
      push @$with_objects, $key, ($more_objects ? @$more_objects : ());
77
      push @$with_objects, _prefix($prefix, $key), ($more_objects ? @$more_objects : ());
78 78
    } else {
79 79
      push @result, _prefix($prefix, $key) => $value;
80 80
    }
t/controllers/helpers/parse_filter.t
58 58
  }
59 59
}, {
60 60
  query => [ 'customer.chart.accno' => 'test' ],
61
  with_objects => bag( 'customer', 'chart' ),
61
  with_objects => bag( 'customer', 'customer.chart' ),
62 62
}, 'nested joins';
63 63

  
64 64
test {
......
82 82
},
83 83
{
84 84
  query => [ 'customer.chart.accno' => { like => '%1200' } ],
85
  with_objects => bag('customer', 'chart' ),
85
  with_objects => bag('customer', 'customer.chart' ),
86 86
}, 'all together';
87 87

  
88 88

  
......
100 100
               'invoice.customer.name'  => 'test',
101 101
               'customer.name'          => 'test',
102 102
             }} ],
103
  'with_objects' => bag( 'invoice', 'customer' )
103
  'with_objects' => bag( 'invoice.customer', 'customer', 'invoice' )
104 104
}, 'object in more than one relationship';
105 105

  
106 106
test {
......
177 177
  }
178 178
}, 'deep laundering, check for laundered hash', target => 'launder', launder_to => { };
179 179

  
180
### bug: sub objects
181

  
182
test {
183
  order => {
184
    customer => {
185
      'name:substr::ilike' => 'test',
186
    }
187
  }
188
}, {
189
  query => [ 'order.customer.name' => { ilike => '%test%' } ],
190
  with_objects => bag('order.customer', 'order'),
191
}, 'sub objects have to retain their prefix';
192

  

Auch abrufbar als: Unified diff