From a8648fc9c18feeeb5bffbb030b00578e2dd1d74d Mon Sep 17 00:00:00 2001 From: Matchu Date: Wed, 22 May 2024 15:47:38 -0700 Subject: [PATCH] Add a limit to the number of items for the Item Getting Guide Just to make it harder to willfully overload the server or whatever! --- app/controllers/items_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/items_controller.rb b/app/controllers/items_controller.rb index 6f47ee54..a05b7294 100644 --- a/app/controllers/items_controller.rb +++ b/app/controllers/items_controller.rb @@ -114,7 +114,8 @@ class ItemsController < ApplicationController def sources item_ids = params[:ids].split(",") - @items = Item.where(id: item_ids).includes(:nc_mall_record).order(:name) + @items = Item.where(id: item_ids).includes(:nc_mall_record).order(:name). + limit(50) if @items.empty? render file: "public/404.html", status: :not_found, layout: nil