Looking over the public methods in IssuesController now, I see that the #reply method is out of place. It’s used to quote a new reply on an issue but it does this via a journal. Since Redmine already has a JournalsController that is used when a journal is edited, it makes more sense to move …
Tag: redmine
Redmine Refactor #91: Pull Up set_flash_from_bulk_issue_save to ApplicationController
This is the final refactoring I want to do on IssueMovesController for now. Using pull up method, I moved the last duplicated method from IssueMovesController to ApplicationController. Before 1 2 3 4 5 6 class IssuesController unsaved_issue_ids.size, :total => issues.size, :ids => '#' + unsaved_issue_ids.join(', #')) end end endclass IssuesController unsaved_issue_ids.size, :total => issues.size, :ids …
Redmine Refactor #90: Pull Up Method to ApplicationController
Now, in order to finish up IssueMovesController, I need to refactor the duplicated methods that I copied from IssuesController. Pull up method is a great refactoring to use in this case. Before 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 class IssuesController < ApplicationController # Filter …
Redmine Refactor #89: Extract Controller: IssueMovesController
With #move and #perform_move separated in the IssuesController, I can now see a clear path to using extract controller to move them to a new controller. (Extract controller is a Rails specific refactoring that is based on extract class). Before 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 …
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 …