Tag: ruby

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 …

Read more

Problems when you don’t Refactor Rails: Test Duplication

I’ve already written about the problem of code duplication when you don’t refactor Rails. A similar problem I see all the time is test duplication. Test Duplication As Rubyists, we are lucky to have unit testing deeply ingrained in our community. Many developers write tests, some even writing the tests first. But a big problem …

Read more