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 …
Tag: ruby
Redmine Refactor #112: Split Method in FilesController
The next step to refactor Redmine’s ProjectsController is to start converting all of it’s related resources into RESTful controllers. Looking at config/routes.rb, it looks like FilesController is using three custom routes that hang off of ‘/projects/’ and the #new action is being used for both HTTP GET and HTTP POST. So I’ll use split method …
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 …