diff --git a/app/Gemfile b/app/Gemfile index 353e11e..17798ef 100644 --- a/app/Gemfile +++ b/app/Gemfile @@ -26,6 +26,7 @@ group :development, :test do gem 'factory_bot_rails' gem 'faker' gem 'haml_lint', require: false + gem 'rack-mini-profiler', require: false gem 'rspec-rails', require: false gem 'rubocop', require: false gem 'rubocop-factory_bot', require: false 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..bfb38b5 --- /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