The Refactoring Today I finally tackled a larger refactoring that I’ve been wanting to do for awhile now. Redmine’s IssuesController has accumulated a lot of extra actions over the years, one of which is an action that renders a Gantt chart. This has never made sense to me, since the Gantt chart collects a bunch …
Tag: ruby
Daily Refactor #64: Move Method to QueriesHelper
The Refactoring To continue refactoring Redmine’s IssuesController, I used move method to move a utility method to the QueriesHelper. Before 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 …
Daily Refactor #63: Extract Method to before_filter in IssuesController
The Refactoring Mark Thomas pointed out some odd code in Redmine’s IssuesController#build_new_issue_from_params, specifically that it’s doing some error checking in the middle of a method body. Before 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 # …
Daily Refactor #62: Extract Method in IssuesController
The Refactoring Today’s refactoring follows up on yesterday’s. Now that I have the #new and #create actions for REST, I can start to remove the duplication I introduced. Before 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 …
Daily Refactor #61: Extract Method in IssuesController for REST
Now I’m starting to refactor Redmine’s IssuesController again in order to have it match the standard Rails REST controllers. This time I’m working on the new/create action pair. The Refactoring This refactoring splits the single #new action into the two separate actions. Before 1 2 3 4 5 6 7 8 9 10 11 12 …