Over the weekend, Rails 2.0 was released to the masses. Packed with a flurry of changes, I decided to take the plunge. After grabbing a Coke, turning on some music, and firing up TextMate, it was time to rock and roll. One of the new features included in the release was RequestForgeryProtection, one that I wanted to take full advantage of to help protect against CSRF-based attacks. Considering I've been keeping current with each release cycle of Rails, I was hoping that the upgrade from 1.2.6 to 2.0 would be a piece of cake. Well, long story short, it wasn't. Not suprising I'm sure, but it was another late night of code wrangling that ended up putting me to bed around 5:20am on a Saturday morning.
After upgrading and running rake for the first time, I was presented with more errors and test failures than there are light bulbs on the Grizwald's house during Christmas. At a high-level, here are the issues that I ran into:
- Mailer tests were failing for no good reason. Turns out that you can't have a method with the name request in a Mailer or it provides some really wonky results. Luckily #rubyonrails folks helped me through this one.
- render_partial was deprecated so I had to move to render :partial
- paginating_find was somewhat broke, but this was my own fault
- A number of tests were failing because I have tests that test to make sure the right errors are returned and somewhere in the upgrade, someone decided it was a good idea to sort in the opposite direction. Thus [apple, orange, pear] now had to be [pear, orange, apple] for the test to pass.
- Blog and article preview functionality failed the forgery protection due to the way I hacked it to work. I redid this the right way.
- Recent music tracks was failing forgery protection because I was using a POST instead of a GET, dumb in the first place on my part.
After fixing all of the above, I had things up and running again. Deployed on Saturday, December 8 @ around 5:20am, ePartment54 is now running Rails 2.0. I also considered changing to the new CookieStore offered in Rails 2.0, but decided against it and am sticking with ActiveRecordStore. I just couldn't convince myself that client-side session storage was the right solution for me.
Hoo rah for Rails 2.0!!!


I'm still holding out for Perl on Rails for epartment54.