Things I had to fix for Rails 2.2.2

29 11 2008

The new features in Ruby on Rails 2.2.2 have been well documented, and I’m looking forward to using several of them on WhatYouAte.com. If you’re reading this you probably are too.

However, if you’re upgrading an existing project and you’re sticking with official releases (as opposed to edge Rails) like I am, your code probably needs some tweaking to work with Rails 2.2.2. Mine certainly did. Although there were a lot of failed tests with ugly stacktraces, there were only a few API changes in Rails that needed to be accomodated to fix them all. Here’s a list of the changes that broke my app, and what I had to do to get it working again.
Read the rest of this entry »



EphemeralModel, for Rails 2.2.2 form validation without a DB table

29 11 2008

I recently upgraded WhatYouAte.com to Rails 2.2.2. I had been using advice from the Rails Wiki’s HowToUseValidationsWithoutExtendingActiveRecord page. I was using a class based on the RailsWeenie code (that site is down now) and it stopped working. Here’s a new replacement hack that works almost identically.
Read the rest of this entry »



Hiding a CLI-only user account in Mac OS X 10.5 Leopard

5 11 2008

A year and a half ago I installed the excellent PostgreSQL via MacPorts, and had to create a user account manually. Annoyingly, this postgres user shows up in the GUI login screen and Fast User Switching menu under Leopard. I found a fix today.
Read the rest of this entry »



Ubuntu Linux 8.04 “Hardy Heron” Upgrade Report

8 09 2008

Painless! I’m actually starting to expect it to work without hitches now.

There are a couple of config file changes that need babysitting but none of them was difficult; I really do wish it would automatically do a three way merge between its old package version, the new version, and my version, and just assume “yes” if they merge cleanly.

Instructions are trivial: see Hardy Upgrades: Network Upgrade for Ubuntu Servers (Recommended).

This also works fine on Xen.



On Anthropomorphizing Code

27 08 2008

I haven’t read enough Heinlein to be sure that I like the guy, but he gets major brownie points for TANSTAAFL. jwz gets brownie points for several reasons, not the least of which is for having written, Linux is only free if your time has no value.

I try to avoid the mistake of saying that an inanimate object or non-corporeal hunk of information “needs” something, but I fail sometimes. For example, I said “I just think that ActiveRecord needs to support the low-level and middle-level abstractions better.” This is silly; of course, code doesn’t need anything per se.

You may think I’m being pedantic by saying this, but people commonly mix up whose needs are really being described. What I should have said was, “I would be happy with ActiveRecord if it supported…”, clearly indicating that the need was mine. I have a problem, and this code doesn’t solve it fully. And I understand that I, and maybe some like-minded individuals, bear the burden of actually trying to solve this problem. If I sit and wait and it gets fixed, that’s great, but it’s not fair for me to demand that the universe solve all my problems for me just because it has solved a few of them already without me doing any work.
Read the rest of this entry »