Yesterday’s refactoring to the ReportsController helped to move some of the ActiveRecord::Base#select_all methods out of the controller but I was still left with the duplication in the Issue model. Today, I’ll dig into those model methods and remove most of the duplication. The Refactoring Before 1 2 3 4 5 6 7 8 9 10 …
Why I don’t use HAML or SASS
Seeing as the ERB vs HAML decision has now reached the armed conflict status, I figured that I would voice my opinions before it becomes yet another holy war. HAML, SASS, and ERB are all tools. From what I’ve seen, they are all very good quality and they all have their shortcomings. You can write …
Daily Refactor #8: Move method in the ReportsController
The Refactoring This is the first part to a larger refactoring of the ReportsController in Redmine. This controller is responsible for calculating the total number of issues based on different criteria (e.g. issue status, issue priority). There are two big problems with the current code: It has a lot of duplication, both in the main …
Daily Refactor #7: Extract method in fetch_changesets
Working off of Caliper’s flay report for Redmine, I was able to refactor another code duplication. The Refactoring Redmine supports connecting to seven different source control systems to import their changes (e.g. git, subversion, mercurial). When Redmine runs the import, it adds each Changeset (a commit) into the database and also information about each Change …
Daily Refactor #6: Move recipients method to acts_as_event
This week I’m planning to do some refactoring on Redmine’s code base. Today I fixed a smell that Caliper found with flay. The Refactoring Redmine has several model objects that generate Events, which are listed on it’s Activity Page and cause email notifications to be sent. A few of these models had identical recipients methods …