Today is a great day for me; I’m finally launching Refactoring Redmine. Refactoring Redmine is an ebook of 82 real world Ruby on Rails refactorings that I’ve done to Redmine. If you’re a reader of this blog, you have probably seen some of my refactoring over the past year. If you ever had trouble learning …
Redmine Refactor #111: Convert ProjectEnumerations to resource
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 …
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 …