From 90a7b15db3116a3072e35d6686b17054ebcf7671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20=C5=A0vara?= Date: Tue, 20 Jan 2026 12:32:45 +0100 Subject: [PATCH] Move pins scope into a variable. Keep web limit to 20 and set JSON to 100. --- app/controllers/my/pins_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/my/pins_controller.rb b/app/controllers/my/pins_controller.rb index 93b77df79..70e40ce98 100644 --- a/app/controllers/my/pins_controller.rb +++ b/app/controllers/my/pins_controller.rb @@ -6,10 +6,12 @@ class My::PinsController < ApplicationController private def pins_for_request + pins = Current.user.pins.includes(:card).ordered + if request.format.json? - Current.user.pins.includes(:card).ordered + pins.limit(100) else - Current.user.pins.includes(:card).ordered.limit(20) + pins.limit(20) end end end