Fix compatibility with rails 4.1.0.rc1

See https://github.com/rails/rails/commit/c390e60811b2e11bfd5d79b15bfb43690c1a1339