Fix compatibility with new rails