From b9e86af80adbd07b605c767e140711853f193f81 Mon Sep 17 00:00:00 2001 From: "sentry-autofix[bot]" <157164994+sentry-autofix[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 16:20:31 -0800 Subject: [PATCH] Convert Active Record Relation to Array in Products Controller (#651) Co-authored-by: sentry-autofix[bot] <157164994+sentry-autofix[bot]@users.noreply.github.com> Co-authored-by: Kosty Maleyev --- ruby-on-rails/app/controllers/api/v1/products_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruby-on-rails/app/controllers/api/v1/products_controller.rb b/ruby-on-rails/app/controllers/api/v1/products_controller.rb index 6a2114f7..d4112f8d 100644 --- a/ruby-on-rails/app/controllers/api/v1/products_controller.rb +++ b/ruby-on-rails/app/controllers/api/v1/products_controller.rb @@ -16,7 +16,7 @@ def index span_products_slow_db = transaction.start_child(op: "custom.reviews_slow_db_call") prod_slow["pg_sleep"] = "" prod_slow["reviews"] = [] - prod_slow["reviews"] = Reviews.select("id, productid, rating, customerid, description, created, Null as pg_sleep").where("productid="+prod_slow.id.to_s) + prod_slow["reviews"] = Reviews.select("id, productid, rating, customerid, description, created, Null as pg_sleep").where("productid="+prod_slow.id.to_s).to_a span_products_slow_db.finish end