I had to change this to get it to work on rails 3.