Make it possible to initialize meta_request in an initializer #120
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Inspired by rack-mini-profiler I wanted to be able to conditionally enable and disable meta_request through environment variables.
We have a few tools for benchmarking pages and including them all each time we run our development server is not what we want. With my changes you can make a custom initializer and do this:
The condition can be anything you want really.
I also added some documentation on the matter in de README.
I wasn't sure if you'd even be interested to merge this into the project, so I haven't written the tests yet. Also I think you know better what you want to do with those.
My take is that you can create some sort of group in the rails project under test/functional and then conditionally run using the 'normal' group and the one where meta_request has
require: false
and use an initializer in that case that does what my example above does.Anyway. Let me know what you think.