Now there is only one non-REST method inside of NewsController left. Today, using move method, I refactored #preview to move it to the dedicated PreviewsController. Before 1 2 3 4 5 6 7 8 9 10 11 class NewsController [:new, :create, :index, :preview] before_filter :find_project_from_association, :except => [:new, :create, :index, :preview] before_filter :find_project, :only => …
Tag: move-method
Redmine Refactor #120: Move Method from NewsController to CommentsController
Since I created the CommentsController yesterday, today I’m going to move the #destroy_comment method over to it. I also threw in a bit of rename method magic to make it match the RESTful naming conventions. Before 1 2 3 class NewsController 'show', :id => @news end endclass NewsController 'show', :id => @news end end 1 …
Redmine Refactor #106: Move method from ProjectsController#reset_activities to ProjectEnumerationsController#destroy
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 …
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 …