Photo-1 Photo-2 Photo-3 Photo-4 Photo-5 Photo-6

@brentmc79

@brentmc79

Full-time web developer. Part-time smart ass.

I'm Brent Collier.

After a year and a half as an engineer on Twitter's Trust & Safety team, I'm looking for my next gig. Contact me if you know of something interesting.

#

Keeping the pace

Posted on 08/12/2008

I'm currently working on a fairly large rails app that's been in development for the past couple of years. In fact, when it first began I think Rails was only at version 1.1 or 1.2.

A lot's changed since then, both in Rails and the app. I've been doing Rails development for over a year now, but I'm still far from an expert. I often find myself looking at a bit of code and wondering if it's some part of Rails (or ruby) that I'm not familiar with, or if it's something specific to our app. We have a lot of custom framework code, and given the size and age of our app, it's not unlikely.

Well, I found a case today in which it was both. I was in the middle of replacing a bit of classic_pagination with will_paginate and I noticed that it kept choking on hash.except(keys). I thought this was a little odd since it was plugin code, which I was pretty sure we hadn't modified. After a little poking around, I found that the except method was defined in a Hash extension in the lib/ directory. There was no way that will_paginate was referring to a bit of our code!  A quick Google search later, I found that ActiveSupport added the except method to Hash. Clearly one of two things had happened. Either we had implemented our own version of hash.except before it made it into Rails, or it had already been added to ActiveSupport, but we were just lagging behind on our Rails version.

When working in a field where the tools change so rapidly, it's very important to keep up with any changes that are made. This is especially important when the development lifetime of an app spans multiple releases of a framework.