make this work in rails 4. Not sure if that was the right change to make though.