From 4735f51886a5d7e139626c495938dd59ad541888 Mon Sep 17 00:00:00 2001 From: RyanTG Date: Sat, 11 Jan 2025 11:54:28 -0800 Subject: [PATCH] limit nearby activity to 200 limit nearby activity to 300 --- app/controllers/user_submissions_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/user_submissions_controller.rb b/app/controllers/user_submissions_controller.rb index 3b5c57dc..70809760 100644 --- a/app/controllers/user_submissions_controller.rb +++ b/app/controllers/user_submissions_controller.rb @@ -14,9 +14,9 @@ def create def list_within_range user_submissions = UserSubmission.where.not(lat: nil) .where(submission_type: %w[new_lmx remove_machine new_condition new_msx confirm_location],created_at: '2019-05-03T07:00:00.00-07:00'..Date.today.end_of_day) - .near([params[:lat], params[:lon]], 100, order: false) + .near([params[:lat], params[:lon]], 100, order: false).limit(200) sorted_submissions = user_submissions.order('created_at DESC') - render partial: "maps/nearby_activity", locals: { sorted_submissions: sorted_submissions } + render partial: 'maps/nearby_activity', locals: { sorted_submissions: sorted_submissions } end private