Fix deprecation warnings in rails 4.0.0.rc1

This fixes #180.