From 0f82387c48f7ff7eb3f89587b5d701a09291e822 Mon Sep 17 00:00:00 2001 From: puppe1990 Date: Tue, 5 Nov 2024 14:18:08 -0300 Subject: [PATCH] change to use find the sku case insensitive --- app/controllers/products_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index ba814ac3..c7bf55c3 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -234,7 +234,9 @@ def print_tags def print_tags_by_skus skus = params[:sku_list].to_s.split(/\r?\n/).map(&:strip).reject(&:blank?) - @products = Product.where(account_id: current_tenant, sku: skus) + # Using ILIKE for case-insensitive matching + @products = Product.where(account_id: current_tenant) + .where("sku ILIKE ANY (ARRAY[?])", skus.map { |sku| sku }) @copies = params[:copies].to_i if @products.empty?