Improved Rails compatibility