From b933072713846b0cce2a650c020232f1847baadc Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 27 Aug 2014 14:16:39 +0200 Subject: [PATCH] [PASSED QA] Bug 12830: use find instead of search Since ordernumber is the pk, it is stupid to use search. Signed-off-by: Paola Rossi Signed-off-by: Katrin Fischer All acquisition related tests and the QA script pass. I can't find any regressions with these patches. --- Koha/Acquisition/Order.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Koha/Acquisition/Order.pm b/Koha/Acquisition/Order.pm index d6cfa8e..67a9982 100644 --- a/Koha/Acquisition/Order.pm +++ b/Koha/Acquisition/Order.pm @@ -17,11 +17,10 @@ sub fetch { return unless $ordernumber; my $schema = Koha::Database->new->schema; - my $rs = - $schema->resultset('Aqorder')->search( { ordernumber => $ordernumber }, + my $order = + $schema->resultset('Aqorder')->find( { ordernumber => $ordernumber }, { result_class => 'DBIx::Class::ResultClass::HashRefInflator' } ); - - return $class->new( $rs->first ); + return $class->new( $order ); } sub insert { -- 1.9.1