I decided to start splitting the dual method actions in the ProjectsController (dual method: takes GET and POST requests to perform two separate actions). I wanted to merge some of the extra actions like #archive into these methods first but I think it will be easier once the dual methods are split up. I might …
Tag: extract-method
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 #88: Extract Method from move and perform_move
Now that #move and #perform_move are separated, I can start to refactor the duplication they share. 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 class IssuesController false if …
Redmine Refactor #87: Extract Method Body to IssuesController#perform_move
With this refactoring I start making some major changes to IssuesController#move and #peform_move. Before 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 class IssuesController params, :issue => issue, :target_project => @target_project, :copy => !!@copy }) if r = issue.move_to_project(@target_project, new_tracker, {:copy => @copy, :attributes …