Skip to content

Commit

Permalink
change to use find the sku case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
puppe1990 committed Nov 5, 2024
1 parent 73ac0ac commit 0f82387
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/controllers/products_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down

0 comments on commit 0f82387

Please sign in to comment.