fix for rails 4.1

Changes based on https://github.com/rails/rails/commit/ec8d8652f36bc4bf2ea19b8f7dd264187efc99ae commit. rails-dummy work fine for rails to 4.0.x but for 4.1.0 it not work.