Bug 24191: Make objects.search pass to_model to dbic_merge_sorting

This patch makes objects.search pass the to_mode method reference so it
can be used to map API attributes to column names when building the
sorting portion of the query.

To test:
1. Apply the regression tests on this patchset
2. Run:
  $ kshell
 k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t
=> FAIL: Tests fail!
3. Apply the rest of the patchset
4. Run:
 k$ prove t/Koha/REST/Plugin/Query.t
=> SUCCESS: Tests pass! changes to the methods work as expected!
5. Run:
 k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t
=> SUCCESS: Tests pass!
6. Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Tomas Cohen Arazi 2019-12-09 15:31:36 -03:00 committed by Martin Renvoize
parent 741b9a1c73
commit ea7311fedf
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 2 additions and 1 deletions

View File

@ -60,7 +60,8 @@ sub register {
$c->dbic_merge_sorting(
{
attributes => $attributes,
params => $reserved_params
params => $reserved_params,
to_model => $to_model
}
);