Tag: refactoring

Redmine Refactor #124: Rename Method UsersController#add

To finish up yesterday’s refactoring of UsersController#add I used rename method to rename #add to #new. Before 1 2 3 4 class UsersController Setting.default_language) @auth_sources = AuthSource.find(:all) end endclass UsersController Setting.default_language) @auth_sources = AuthSource.find(:all) end end After 1 2 3 4 class UsersController Setting.default_language) @auth_sources = AuthSource.find(:all) end endclass UsersController Setting.default_language) @auth_sources = AuthSource.find(:all) end …

Read more

Redmine Refactor #121: Move Method from NewsController to PreviewsController

Now there is only one non-REST method inside of NewsController left. Today, using move method, I refactored #preview to move it to the dedicated PreviewsController. Before 1 2 3 4 5 6 7 8 9 10 11 class NewsController [:new, :create, :index, :preview] before_filter :find_project_from_association, :except => [:new, :create, :index, :preview] before_filter :find_project, :only => …

Read more