Compatibility with (latest) Rails 4.2.

See https://github.com/rails/rails/issues/16578.