mirror of
https://github.com/System-End/hackatime.git
synced 2026-04-19 19:55:16 +00:00
Run rack mini profiler in production
This commit is contained in:
parent
c3dac98855
commit
3f55de928f
2 changed files with 11 additions and 5 deletions
10
Gemfile
10
Gemfile
|
|
@ -72,6 +72,11 @@ gem "http"
|
|||
# Bulk import
|
||||
gem "activerecord-import"
|
||||
|
||||
# Rack Mini Profiler [https://github.com/MiniProfiler/rack-mini-profiler]
|
||||
gem "rack-mini-profiler"
|
||||
# For memory profiling via RMP
|
||||
gem "memory_profiler"
|
||||
|
||||
group :development, :test do
|
||||
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
|
||||
gem "debug", platforms: %i[ mri windows ], require: "debug/prelude"
|
||||
|
|
@ -90,11 +95,6 @@ group :development do
|
|||
# Preview emails in the browser [https://github.com/ryanb/letter_opener]
|
||||
gem "letter_opener"
|
||||
gem "letter_opener_web", "~> 3.0"
|
||||
|
||||
# Rack Mini Profiler [https://github.com/MiniProfiler/rack-mini-profiler]
|
||||
gem "rack-mini-profiler"
|
||||
# For memory profiling via RMP
|
||||
gem "memory_profiler"
|
||||
end
|
||||
|
||||
group :test do
|
||||
|
|
|
|||
|
|
@ -2,6 +2,12 @@ class ApplicationController < ActionController::Base
|
|||
before_action :set_paper_trail_whodunnit
|
||||
before_action :initialize_cache_counters
|
||||
|
||||
before_action do
|
||||
if current_user && current_user.is_admin?
|
||||
Rack::MiniProfiler.authorize_request
|
||||
end
|
||||
end
|
||||
|
||||
# Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
|
||||
# allow_browser versions: :modern
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue