For many years now a pattern has emerged in my Rails websites. Most models will have Title, Description, Online at, Offline at, Is visible, Url and Image_file_name fields. It screams to be solved using an underlying common model using the “is_a” pattern. There is no clean way to solve this in Rails. I discovered this post though, which outlines a good method to solve this problem.
Category Archives: rails
Election special
Seems like the crisis in our parliament has become global news. Guess “our boys” did some fine things in Uruzgan. Too bad the majority of the country wants to end the war. Anyway. I recently built the election special for www.radio1.nl. I just love how fast I can whip up specials like this in Ruby on Rails, and integrate it into the core of the app without making the code any dirtier.
MegaMythen: play with the Greek Gods
Late last year I have built the back-end for a very slick online game called MegaMythen. In this game you can play with the ancient Greek Gods and travel up mount Olympus. This game has launched today and it looks even better than I had imagined. The gameplay is very intuitive and smooth. I urge you to check it out even if you don’t play games at all: www.megamythen.nl.
Rails 3
Open Source ftw
I love open source. And I love contributing to open source projects. Every time one of my patches is accepted into a project, I can’t help but smile.
Throttle ActiveRecord creation
One of the sites I maintain, www.radio1.nl, was recently bombarded by GeenStijl. This is the Dutch equivalent of a slashdotting. The app held up quite well, even though I hadn’t explicitly hardened the application.
Foreign keys in Ruby on Rails
For a long time I have been searching for built-in foreign keys in Ruby on Rails. For some reason, the core developers don’t think it’s particularly important. I don’t know why. I think foreign key constraints are absolutely essential, but who am I?
Skipping gem docs on production server
Just thought about this now: skipping gem documentation on the production server. Makes much more sense.
Elfproef validation in Rails
Oops, did it again… I moved my second plugin to Github just now. This one checks a bank account number in a Rails application to see if it’s valid. Dutch bank account numbers conform to the “Elfproef” checksum, so that’s a handy little tool. Continue reading
Check for DNSBL inside Rails app
Quite a few years ago I wrote a plugin for Ruby on Rails. It checks incoming client connections against DNS Blackhole Lists. It has worked quite well over the years. In the mean time I moved all my code from Subversion to Git, but somehow never moved the plugin. Until now!