Change insert before to rack::runtime for rails 4