I’m going to take a break from my Kanban plugin today to show a refactoring I did to Redmine last night for a client. Redmine has a model called CustomField. This is shared by several other models to let users add custom data to their issues, projects, users, etc. Each of these custom fields has …
2 Steps to Becoming a Great Developer
I want to share the two steps that I’m using to walk the path to becoming a great developer. Becoming a great developer is a constant work in progress, but it’s a pattern that I’ve seen many other great developers follow. Step one: Write more code This might sound easy but trust me, it’s not …
Daily Refactor #56: Replace Accumulator with Inject
The Refactoring Today’s refactoring is a simple one that makes use of Ruby’s #inject. #inject is a great method for building accumulators but I don’t see it that often in Rails code that much (including my own). Before 1 2 3 4 5 6 7 8 9 10 11 12 # app/models/kanban_pane/active_pane.rb class KanbanPane::ActivePane < …
Daily Refactor #55: Move Pane Configuration To KanbanPane
The Refactoring I picked a big refactoring today. What started out as a small isolated change, grew and grew as I found dependencies all over the plugin. I used move method primarily but there are several other refactorings along for the ride. Before you get hit with the wall of code, look for the code …
Daily Refactor #54: Move Method to KanbanPane
The Refactoring Today I did another simple refactoring by moving a method from Kanban to KanbanPane. Before 1 2 3 4 5 6 7 8 9 10 11 12 # app/models/kanban.rb class Kanban # Sort and group a set of issues based on IssuePriority#position def group_by_priority_position(issues) return issues.group_by {|issue| issue.priority }.sort {|a,b| a[0].position b[0].position } …