Now I want to start refactoring IssuesController#move so it’s two separate actions; one to display the form and one to do the actual move. This will make adding more RESTful urls and APIs to Redmine easier. To start, I create a second method that wraps the existing #move method so I can change the routing …
Tag: extract-method
Redmine Refactor #85: Extract Method in IssuesController#move
Whenever I work with legacy code I always turn to extract method and move method for most of my refactoring. Redmine’s IssuesController is no exception. Using extract method on the #move action I was able to extract several lines of code deep in the method and also remove a temporary variable. Before 1 2 3 …
Redmine Refactor #84: Extract Method in IssuesController#context_menu
I’m starting to refactor Redmine’s IssuesController again. It’s a very cluttered controller that hasn’t been refactored as it’s grown, so I’ll need to build up my confidence with it over the next few refactorings. To start I used extract method to pull out a new useful utility method to the ApplicationController. Before 1 2 3 …
Redmine Refactor #82: Extract Method to shoulda Macro in AccountControllerTest
I’m starting on my daily refactors again but this time I’m going to focus on the Redmine core codebase. With Redmine’s recent 1.0 release, I now have the flexibility to make some major changes to it’s internal code to get it ready for some new features. To start, I wanted to use extract method to …
Daily Refactor #77: Extract and Move Method in InvoiceController
Since I’m all hopped-up on white tea from an early morning meeting, this refactoring is a two in one. The Refactoring I used move method and extract method on the InvoiceController to move the business logic down into the model where it belongs. Before 1 2 3 4 5 6 7 8 9 10 11 …