In today’s refactoring, I finished up refactoring ProjectsController to ProjectEnumerationsController. Using move method I moved #reset_activities to ProjectEnumerationsController and renamed it to #destroy.
Before
1
2
3
| class ProjectsController 'projects', :action => 'settings', :tab => 'activities', :id => @project
end
end |
1
2
| class ProjectEnumerationsController < ApplicationController
end |
After
1
2
3
| class ProjectsController < ApplicationController
# Removed reset_activities method
end |
1
2
3
| class ProjectEnumerationsController 'projects', :action => 'settings', :tab => 'activities', :id => @project
end
end |
With this refactoring complete, ProjectsController is almost ready to be converted to a REST resource. There are three more methods that I think should be merged into other methods (#modules, #archive, and #unarchive) and then some more methods that should be split (#edit to #edit and #update).
Reference commit
Share
Related posts:
- Daily Refactor #54: Move Method to KanbanPane
- Daily Refactor #53: Move Method to KanbanPane
- Daily Refactor #31: Extract Method in IssuesHelper#show_detail
- Daily Refactor #30: Move Method into Issue
- Daily Refactor #8: Move method in the ReportsController
About Eric Davis
I founded
Little Stream Software where I provide Redmine and ChiliProject services to help projects teams. I also created an ebook,
Redmine Tips, were I show you how to become more productive using Redmine.
I am also the author of Refactoring Redmine, where I go about
refactoring Rails using Redmine as an example.