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
end |
class IssuesController unsaved_issue_ids.size,
:total => issues.size,
:ids => '#' + unsaved_issue_ids.join(', #'))
end
end
end
1
2
3
4
5
6
|
class IssueMovesController unsaved_issue_ids.size,
:total => issues.size,
:ids => '#' + unsaved_issue_ids.join(', #'))
end
end
end |
class IssueMovesController unsaved_issue_ids.size,
:total => issues.size,
:ids => '#' + unsaved_issue_ids.join(', #'))
end
end
end
1
2
3
|
class ApplicationController < ActionController::Base
# ...
end |
class ApplicationController < ActionController::Base
# ...
end
After
1
2
3
|
class IssuesController < ApplicationController
# ...
end |
class IssuesController < ApplicationController
# ...
end
1
2
3
|
class IssueMovesController < ApplicationController
# ...
end |
class IssueMovesController < ApplicationController
# ...
end
1
2
3
4
5
6
|
class ApplicationController unsaved_issue_ids.size,
:total => issues.size,
:ids => '#' + unsaved_issue_ids.join(', #'))
end
end
end |
class ApplicationController unsaved_issue_ids.size,
:total => issues.size,
:ids => '#' + unsaved_issue_ids.join(', #'))
end
end
end
Now that IssueMovesController is done, I can go back to IssuesController and work on the next set of refactorings. It’s finally starting to really shrink, there are only 14 public actions left which should only take a few more weeks to resolve.
- index
- changes
- show
- new
- create
- edit
- update
- reply
- bulk_edit
- destroy
- context_menu
- update_form
- preview
- auto_complete
Reference commit