diff --git a/app/Gemfile b/app/Gemfile index 353e11e..8f2bdd9 100644 --- a/app/Gemfile +++ b/app/Gemfile @@ -32,4 +32,5 @@ group :development, :test do gem 'rubocop-rails', require: false gem 'rubocop-rspec', require: false gem 'rubocop-rspec_rails', require: false + gem 'rack-mini-profiler', require: false end diff --git a/app/Gemfile.lock b/app/Gemfile.lock index 7b9d1cc..b0f206d 100644 --- a/app/Gemfile.lock +++ b/app/Gemfile.lock @@ -234,6 +234,8 @@ GEM nio4r (~> 2.0) racc (1.8.1) rack (3.1.7) + rack-mini-profiler (3.3.1) + rack (>= 1.2.0) rack-protection (4.0.0) base64 (>= 0.1.0) rack (>= 3.0.0, < 4) @@ -381,6 +383,7 @@ DEPENDENCIES pg propshaft puma + rack-mini-profiler rails rails_autolink rspec-rails diff --git a/app/config/initializers/rack_mini_profiler.rb b/app/config/initializers/rack_mini_profiler.rb new file mode 100644 index 0000000..14e63a3 --- /dev/null +++ b/app/config/initializers/rack_mini_profiler.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +if Rails.env.development? + require "rack-mini-profiler" + + # The initializer was required late, so initialize it manually. + Rack::MiniProfilerRails.initialize!(Rails.application) +end