File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -9,11 +9,12 @@ def get_resp
99 begin
1010 query = "SELECT patron_view.record_num, patron_view.id AS patron_record_id, patron_record_address.postal_code" +
1111 " FROM sierra_view.patron_view LEFT OUTER JOIN sierra_view.patron_record_address ON patron_record_address.patron_record_id=patron_view.id" +
12- " WHERE patron_view.record_num IN (#{ @ids . join ( "," ) } );"
12+ " WHERE patron_view.record_num IN (#{ @ids . join ( "," ) } )" +
13+ " ORDER BY patron_view.record_num, patron_record_address.display_order, patron_record_address.patron_record_address_type_id;"
1314
1415 sierra_result = $sierra_db_client. exec_query query
1516 $logger. debug ( "#{ $batch_id} sierra result for #{ @ids . join ( "," ) } : #{ sierra_result . values } " )
16- sierra_result
17+ sierra_result . values . uniq ( & :first )
1718
1819 rescue SierraDbClientError => e
1920 $logger. error "#{ $batch_id} Error fetching Sierra Batch #{ @ids } "
@@ -23,7 +24,7 @@ def get_resp
2324
2425 def match_to_ids ( resp )
2526 rows = resp . map do |row |
26- [ row [ "record_num" ] , { postal_code : row [ "postal_code" ] , patron_record_id : row [ "patron_record_id" ] } ]
27+ [ row [ 0 ] , { postal_code : row [ 2 ] , patron_record_id : row [ 1 ] } ]
2728 end
2829
2930 rows . to_h
You can’t perform that action at this time.
0 commit comments