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!!! 

Current Rating: 4.0 rating from 1 vote

  • Current rating is 4
  •  
  •  
  •  
  •  
  •  

2 Responses to "Going to Rails 2.0"

Default_avatar_thumb

Jason

December 15, 2007 at 01:52 pm

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

263147_thumb

Damon

December 15, 2007 at 03:09 pm

Eh, BBC already beat me to it.

http://www.bbc.co.uk/blogs/radiolabs/2007/11/perl_on_rails.shtml

Comments are Closed

Name: (Required)
Website:
Comment:
Remember my info