Two years ago Dave Thomas did a keynote at the first RailsConf in 2006 and outlined a few things missing in Rails. One was the seeming unnecessary un-DRYness of duplicating associations and validations in Active Record models since the same information is in the DB schema. Another was support for Composite Primary Keys on Active Record models.
A few weeks later I created my first RubyGems as an attempt to solve these problems: Dr Nic’s Magic Models and Composite Primary Keys. The former was funny and an entertaining way to use
Class.new. The latter was not funny. It started at the heights of “mildly entertaining,” dropped down from there and then over the subsequent months it never again rose above the humour-scale heights of “please shoot me in the foot.”
There were entire months that I hated ever having created the Composite Primary Keys project
Why? It sits precariously atop of ActiveRecord::Base, and a half dozen other ActiveRecord classes. It overrides methods, recreates entire blocks of SQL, and must work on all the different database adapters. That is, it is very sensitive to many changes in edge Rails. And refactoring ActiveRecord is a favourite pastime of the Rails Core team.
Unlike the Magic Models project which is perfectly useful for party tricks but probably partially pointless elsewhere, the CPK project just seemed to be so damned useful to some people.
Many people kept using it, several people contributed patches for adapter support and new features, and finally the Prophet arrived. The man that would lead the faithful forward to the Promised Land.
His name is Darrin “Champion” Holst.
Today, CPK was given the golden release number 1.0.0 and officially supports Rails 2.1 (but no longer supports 2.0.2 afaik).
I’d like to name this release the “we’re running out of 0.9.x numbers, so it has to go to 1.0 sooner or later” release.
Maintaining CPK is like being on the team that paints the Sydney Harbour Bridge – it takes then 12 mths to paint it from one end to the other, which is just in time to restart painting the bloody thing again.
So in every way that I (tried to) abandon the project, I am proud of Darrin for looking after it and all its users.
- Instant new Rails applications with the App Scrolls When I start a new project I want to start...
- Install any HTML theme/template into your Rails app Have you ever even bothered to Google for “rails...
- Closing in on The Dream: “one-click-to-deploy Rails apps” Got a simple app you want to build? Allocate...
- Sample Rails app: multi-OpenIDs per user Last time, on “Dr Nic loves OpenID”… Dr Nic had...
- Magic Multi-Connections: A “facility in Rails to talk to more than one database at a time” At this point in time thereâ€™s no facility in Rails...