Now that ProjectsController was refactored to a resource, I can start to refactor the other routes to be nested resources. Today I started with ProjectEnumerations since I refactored it to a RESTful design back in refactor #105 and refactor #106. Before 1 2 3 4 5 6 7 8 9 10 11 12 13 14 …
Tag: refactoring
Redmine Refactor #110: Convert ProjectsController’s routes to resources
This is the first of the big refactorings I’ve been working towards. Like refactor #100, this required a lot of work to keep everything working until the rest of the controller refactorings are complete. Before 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 …
Redmine Refactor #109: Extract method ProjectsController#edit to #update
Using extract method on the ProjectsController, I split the #edit method into #edit and #update. This is starting to become a standard refactoring for me now while I convert everything over to RESTful Rails. I’m even thinking about naming this refactoring “split method” or “split action”. Before 1 2 3 4 5 6 7 8 …
Redmine Refactor #108: Rename method ProjectsController#add to #new
During yesterday’s refactoring I noticed ProjectsController was using a method called #add instead of #new. By convention Rails (and RESTful Rails) uses the #new method to render the form to create a new record, so I used rename method today to fix that. Before 1 2 3 4 5 6 7 8 9 10 11 …
Redmine Refactor #107: Extract method #create from ProjectsController#add
I decided to start splitting the dual method actions in the ProjectsController (dual method: takes GET and POST requests to perform two separate actions). I wanted to merge some of the extra actions like #archive into these methods first but I think it will be easier once the dual methods are split up. I might …