metautonomo.us

Confounding URL typists since 2007.

Monthly Archives: May 2008

The local_request That Isn’t

1 Comment

If your Rails application’s primary users are on your company’s intranet, and you host your app using mongrel_cluster and Apache’s mod_proxy_balancer or something similar, you may have noticed a potentially unwanted side effect: users who cause exceptions in your application will get a stack trace instead of your configured error page, even when running in production mode. This is a good excuse to peek into the Rails internals and explain how Rails determines what page to display when it encounters an error.
Read the rest of this post

Filed under Uncategorized
May 30, 2008

Importing Legacy Data to Your Rails Database

1 Comment

A while back, I faced the need to migrate some old data out of a simple web application done by another group within my company. The app was designed on the quick, and basically just dumped all input into one table, without much (any?) sanity-checking. As I sat down with my trusty text editor, ready to whip out a few lines of Perl as I’d done so many times before to quickly scrub and load this data into its appropriate place within its new home, it occurred to me that I was just about to reimplement a bunch of validations and transformations I’d already taken care of once in Ruby. Yes, I had temporarily taken leave of my senses. There had to be a better way, and there was.
Read the rest of this post

Filed under Uncategorized
May 2, 2008