Created
January 7, 2019 16:17
-
-
Save jonniesweb/c17c0587b9478c7d6f53c4e3aee5c5b7 to your computer and use it in GitHub Desktop.
rack_mini_profiler only run if user is authorized and url param is present
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
before_action do | |
if current_user | |
&& current_user.is_admin? | |
&& params(:pp) | |
Rack::MiniProfiler.authorize_request | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment