CSC/ECE 517 Spring 2022 - E2216: Refactor late policies controller: Difference between revisions
Jump to navigation
Jump to search
(Created page with "This page describes the changes made for the Spring 2022 OSS Project E2216: Refactoring late_policies_controller == Description == Write a short description of the project...") |
No edit summary |
||
Line 3: | Line 3: | ||
== Description == | == Description == | ||
Write a short description of the project | Write a short description of the project | ||
== Problems and Solutions == | |||
===='''Problem''':All the late policies will show up on the index page, not just policies created by the current instructor. Need to create public & private late policies. Try to leverage code for private and public courses, assignments, and questionnaires.==== | |||
*'''Solution''': | |||
===='''Problem''':create and update have some duplicate code. Fix that using a partial, _form.==== | |||
*'''Solution''': | |||
===='''Problem''':Both create and update need comments and a better identifier naming.==== | |||
*'''Solution''': | |||
===='''Problem''':Reduce code duplication. Find a way to make the code more DRY.==== | |||
*'''Solution''': | |||
===='''Problem''':Line 64: The if condition can be simplified. ==== | |||
*'''Solution''': | |||
===='''Problem''':Improve the variable name for same_policy_name. (Boolean variables can be named in a better way). ==== | |||
*'''Solution''': | |||
===='''Problem''':Add method comments. ==== | |||
*'''Solution''': | |||
===='''Problem''':Find the use of instance variables in create and update method? Do we really need it? Can it be made local variables instead? ==== | |||
*'''Solution''': | |||
== Modified Files == | == Modified Files == |
Revision as of 16:26, 20 March 2022
This page describes the changes made for the Spring 2022 OSS Project E2216: Refactoring late_policies_controller
Description
Write a short description of the project
Problems and Solutions
Problem:All the late policies will show up on the index page, not just policies created by the current instructor. Need to create public & private late policies. Try to leverage code for private and public courses, assignments, and questionnaires.
- Solution:
Problem:create and update have some duplicate code. Fix that using a partial, _form.
- Solution:
Problem:Both create and update need comments and a better identifier naming.
- Solution:
Problem:Reduce code duplication. Find a way to make the code more DRY.
- Solution:
Problem:Line 64: The if condition can be simplified.
- Solution:
Problem:Improve the variable name for same_policy_name. (Boolean variables can be named in a better way).
- Solution:
Problem:Add method comments.
- Solution:
Problem:Find the use of instance variables in create and update method? Do we really need it? Can it be made local variables instead?
- Solution:
Modified Files
(Add modified files and list of changes here)
Testing
(Add any testing that were added)
Running Tests
rspec ./spec/controllers/late_policies_controller_spec.rb
Pull Request
(Add pull request link here)