Fix deprecation warnings in rails 4.0.0.rc1