Refactor E2509 Reimplement feedback_response_map.rb#293
Refactor E2509 Reimplement feedback_response_map.rb#293aanand-1706 wants to merge 36 commits intoexpertiza:mainfrom
Conversation
Generated by 🚫 Danger |
app/models/response.rb
Outdated
| # Add other response map type email services as needed | ||
| end | ||
|
|
||
| # Gets all active questions that can be scored |
There was a problem hiding this comment.
Isn't the code for calculating scores done with a mixin?
app/models/response_map.rb
Outdated
| self.responses.where(is_submitted: true).exists? | ||
| end | ||
|
|
||
| # Generate a report for responses grouped by rounds |
There was a problem hiding this comment.
Again, I think reporting should be done in other classes.
app/models/response_map.rb
Outdated
| # Groups responses by their round number | ||
| # @param responses [ActiveRecord::Relation] the responses to group | ||
| # @return [Hash] responses grouped by round number | ||
| def self.group_responses_by_round(responses) |
There was a problem hiding this comment.
Six class methods is too many. Refactor.
|
🚨 RSpec Tests Report |
|
🚨 RSpec Tests Report |
|
🚨 RSpec Tests Report |
|
🚨 RSpec Tests Report |
1 similar comment
|
🚨 RSpec Tests Report |
|
🚨 RSpec Tests Report |
|
🚨 RSpec Tests Report |
1 similar comment
|
🚨 RSpec Tests Report |
|
🚨 RSpec Tests Report |
| before_action :set_response_map, only: [:show, :update, :destroy, :submit_response] | ||
|
|
||
| # Lists all response maps in the system | ||
| # GET /response_maps |
There was a problem hiding this comment.
Remove this method. You would never want to list all response maps.
| head :no_content | ||
| end | ||
|
|
||
| # Handles the submission of a response associated with a response map |
There was a problem hiding this comment.
No, this should "obviously" be a method of responses_controller instead.
|
🚨 RSpec Tests Report |
1 similar comment
|
🚨 RSpec Tests Report |
|
🚨 RSpec Tests Report |
2 similar comments
|
🚨 RSpec Tests Report |
|
🚨 RSpec Tests Report |
|
🚨 RSpec Tests Report |
|
🚨 RSpec Tests Report |
|
🚨 RSpec Tests Report |
1 similar comment
|
🚨 RSpec Tests Report |
|
🚨 RSpec Tests Report |
1 similar comment
|
🚨 RSpec Tests Report |
PR being refactored: #182