Starting on my refactoring of Redmine’s ProjectsController, I used extract class to move the #activity method to a new controller. #activity is used to get a timeline of events on a project, so you can see what’s recently happened. Since it’s not tied to an actual project record, it doesn’t fit on ProjectsController. Before 1 …
Tag: redmine
Redmine Refactor #100: Convert Issue Routes to REST Resources
For my 100th refactoring of Redmine, I decided to go big. Today I refactored Redmine’s Issue routes from standard Rails routes to actual REST resources. 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 …
Redmine Refactor #99: Extract method from IssuesController#bulk_update
Now that I refactored Redmine and split the #bulk_edit method, I’m ready to start to refactor the #bulk_update method. Starting with the block of code that’s setting attributes, I used extract method to pull it out into a utility method. Before 1 2 3 4 5 6 7 class IssuesController params, :issue => issue }) …
Redmine Refactor #98: Extract method from IssuesController#bulk_edit
After thinking about how IssuesController#bulk_edit works, I decided to leave it in IssuesController. It doesn’t match Rail’s REST conventions but it does match the REST principles for resource representations. IssuesController returns representations of issue collections and issue objects. Since #bulk_edit works on an issue collection, keeping it in the IssuesController makes sense. There still is …
Redmine Refactor #97: Move method from IssuesController to JournalsController
Starting a fresh week, it’s time to finish up refactoring IssuesController to remove the last of the extra actions. Using move method I was able to move the #changes method to the JournalsController. Before 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 class IssuesController …