New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
E1745. [TLD] Refactor response_controller.rb #1025
Conversation
Refactor response controller
when 'edit' # If response has been submitted, no further editing allowed | ||
response = user_id = nil | ||
action = params[:action] | ||
if %w(edit delete update view).include?(action) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good refactoring!
Hi team,
Thanks, |
participant_type = item.where(user_id: session[:user].id) | ||
next unless participant_type | ||
participant_type.each do |p| | ||
survey_deployment_type = participant_type == CourseParticipant ? AssignmentSurveyDeployment : CourseSurveyDeployment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the logic here is correct. participant_type
is an array of participants, instead of the type of participant. I think this mistake is due to your misleading variable names. And you just refactor code without varifying the correctness.
Tasks completed: