MiniProfiler/rack-mini-profiler — pull request #27 by eileencodes (2013-11-17 21:12:48+00:00)
Title: Mini profiler not running on start

Since updating the railtie to install after known dependencies (HerokuDeflater::SkipBinary and Rack::Deflater) I could not get MiniProfiler to render on start up (from the master branch). The javascript and views were not being inserted into my app.

It seems that because the insert is being run after_initialization that MiniProfiler isn't getting added. I added Rack::Deflator to see if it ran correctly with the new insert_position and the views still were not rendered.

I think the best method would be to instead insert_before ActionDispatch::Static - this is how both HerokuDeflater::SkipBinary and Rack::Deflater are inserted into the middleware as well. This results in the correct order without having to rely on an array of possible middleware.