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 endclass ProjectsController 'projects', :action => 'settings', :tab => 'activities', :id => @project end end 1 …
Tag: redmine
Redmine Refactor #105: Move method from ProjectsController#save_activities to ProjectEnumerationsController#save
Redmine’s ProjectsController is starting to shed actions pretty quickly now. There are two more actions that should belong to a different controller though, #save_activities and #reset_activities. I’m starting on #save_activities today. These two actions affect a project’s Time Entry Activities, basically the “types” of time that is logged to Redmine (e.g. frontend development, testing, database …
Redmine Refactor #104: Move method from ProjectsController#add_file to FilesController#new
Since I created a new FilesController yesterday, I can now move another method over to it from the ProjectsController. ProjectsController#add_file is used for two things: To show the form that’s used to upload a new file To receive a new file upload Since both of these are basic descriptions of what I’d expect a File …
Redmine Refactor #103: Move method from ProjectsController#list_files to FilesController#index
Looking through Redmine’s ProjectsController, I found a few actions that were being used to manage project files. These files are separate resources on a project so using move method and extract class I created a new controller, FilesController. Before 1 2 3 4 5 6 7 8 9 10 11 12 13 14 class ProjectsController …
Redmine Refactor #102: Move method from ProjectsController#roadmap to VersionsController#index
The next refactoring I performed on Redmine’s ProjectsController was to move the #roadmap method to VersionsController. The #roadmap is used to list all Versions on a project. Since that fits Rails’ RESTful conventions for #index, I used move method to move it to the VersionsController. Before 1 2 3 4 5 6 7 8 9 …