The Refactoring Now that yesterday’s split method is done, I can use pull up method to remove several similar before_filters. I had to add a declarative method (#model_object) so each controller can state which model should be used in the finders. Before 1 2 3 4 # app/controller/application_controller.rb class ApplicationController < ActionController::Base # ... end# …
Tag: pull-up-method
Daily Refactor #10: Pull up the #find_project method to the ApplicationController
Back up in the ReportsController, there is still some duplication that needs to be resolved. There are nine methods: 1 controller action (issue_report) 1 private before_filter method (find_project) 7 private utility methods The controller action is ripe for a few refactorings but I wanted to start with the find_project for personal reasons. I used the …