From 070071a3bd013fc7e944a7a7a3f1b1d9644124a6 Mon Sep 17 00:00:00 2001 From: 61315 Date: Mon, 15 Apr 2024 21:10:12 -0500 Subject: [PATCH] fix: response instance made by invitation logic breaks pagination --- rails_root/app/controllers/survey_responses_controller.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rails_root/app/controllers/survey_responses_controller.rb b/rails_root/app/controllers/survey_responses_controller.rb index 8ed2979..9687c4b 100644 --- a/rails_root/app/controllers/survey_responses_controller.rb +++ b/rails_root/app/controllers/survey_responses_controller.rb @@ -62,6 +62,9 @@ def edit return return_to_root 'Your profile could not be found. Please complete your profile.' unless SurveyProfile.exists?(user_id: current_user_id) return return_to_root 'You cannot edit this result.' if current_user_id != @survey_response.profile.user_id + # Initialize page number to 1 if not already set + session[:page_number] = 1 if session[:page_number].nil? + @pagination, @questions, @section = paginate(collection: SurveyQuestion.all, params: { per_page: 10, page: session[:page_number] }) end