Upgrading a Rails app
Now that I have some free time I can work on my golf league Rails app. There’s a bunch of stuff I want to do:
- Upgrade to Rails 1.1
- Upgrade to the stable release of Typo (4.0.x)
- Start using Capistrano for deployment
- Add in some tests
Typo
Last time round I started using Typo to manage news and photos (via Flickr). The problem was that I was using a trunk version (r933), which had some stability issues to say the least, but did the job. The biggest problem was a memory leak that caused DreamHost to kill it off whenever it got some significant load. A lot of these issues have been fixed in the current stable release (4.0.x), and it also uses Rails 1.1, so that’s a good excuse to upgrade (although unnessary for the other bit because it’s a separate app).
One thing I always wanted to do was integrate the admin screens of the league manager as tabs in Typo’s admin pages. I think this is being talked about for 4.1 but isn’t available now. So that doesn’t leave much space for tighter integration, and I don’t like having to maintain two code trees. Typo is also overkill for the odd monthly announcement.
Another thing I’ve considered is using a simpler CMS, e.g. Radiant. I haven’t looked at it much, but it supports something called behaviours, which allows you to do something different on a particular page. That could replace the standalone app that handles leaderboards, forms, etc. Another alternative is to just write a simple news posting system, then I wouldn’t have to worry about merging code bases, user models and all the authentication headaches.
If anyone else has experience in running two Rails apps as part of one web app, I’d love to hear about it.
Rails 1.1
I only just upgraded to 1.0 the last time round. It would be nice to see what the current state of the art is. The main problem here is that my copy of Agile Web Development with Rails only covers Rails 1.0, all my info on Rails 1.1 is a bunch of blog clippings.
What I’d prefer to focus on is the performance and memory enhancements I’ve been reading about on RailsExpress.blog. Rails on DreamHost is slow, and if you consume too much memory, your app gets killed. It’d be nice to sort this stuff out, especially since my users aren’t all technical.
Capistrano
Another pain with Rails is that almost certainly, deploying the thing that works on my laptop onto DreamHost won’t work. I don’t know much about Capistrano, but I’ve heard it takes away deployment pain, so I want to give it a go.
Testing
Being a hobby app there are no tests. Most of the logic is just editing records so I don’t need tests, but there are some tricky scoring and ranking things that should be verified with test cases. After that there’s ZenTest. It’s an automated tester that makes sure everything is still working with each change. It’s a different style of development that I’d like to try, it sounds a lot more helpful than occassionaly doing an ‘ant test’ that takes several minutes to run.

September 20th, 2006 at 8:16 pm
“Being a hobby app there are no tests.“. There may be good reasons for not writing tests, but that is not one of them…
September 21st, 2006 at 3:24 am
How about it’s the first thing I did in Rails so I wanted to see what I could do?
Not having tests has bitten me a few times so I do want to get around to writing them.
September 22nd, 2006 at 12:58 pm
I think you have to be selective about what you test. It takes time to write tests so it only make sense to write tests for those parts of the system that are complex.
September 24th, 2006 at 9:51 pm
You’re definitely right, you can’t test everything. But one thing I have found it that you can design your code so it’s easier to test. Recently I’ve been using IoC containers and mock objects to do interaction testing and it makes that type of testing so much easier. I always hated writing tests that seemed to require the entire system to be running because they took so long and were so fragile.