Skip to content

Commit

Permalink
fix: response instance made by invitation logic breaks pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
61315 committed Apr 16, 2024
1 parent 39d7bcf commit 070071a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rails_root/app/controllers/survey_responses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 070071a

Please sign in to comment.