Ruby

http://s.erious.ly

Rail Spikes

10 Cool Things in Rails 2.3

This was presented to the Ruby Users of Minnesota on March 30, 2009. Here’s a quick look at 10 new Rails features that I think are cool. Not all of them are huge new features, but instead help solve annoying problems. I’ve also crea......

Slow tests are a bug

I’ve been doing TDD for about three years now. Once I figured out how to do it right, it became a natural part of how I program, and I can’t really imagine doing development without it. This isn’t to say that TDD is...

Dealing with ‘duplicate key violates unique constraint’ on the primary key

I recently had to work through a problem where inserts were failing due to duplicate primary keys. Here’s the error (edited for clarity): PGError: ERROR: duplicate key violates unique constraint "contracts_pkey": INSERT INTO "contr...

Today’s hard-won lesson

An float subtracted from an integer results in a float. When typecast by ActiveRecord, this is converted to an integer. validates_numericality_of with :only_integer => true results in a rather obscure error message if a non-integer i...

Fetcher moved to GitHub

A quick FYI for those who have been using the Fetcher plugin that we wrote (and use on FanChatter Events)... I have moved the Fetcher plugin repository to GitHub. You can get it at git://github.com/look/fetcher.git Happy forking! ...

Rescuing autotest from a conflicting plugin

For the longest time, I wasn’t able to run autotest on one of my projects. That was OK; I was intrigued by autotest, but had never really committed to it. The problem: whenever I would try to run autotest, I’d get the following...