Skip to content

Commit

Permalink
Also log with strict_loading
Browse files Browse the repository at this point in the history
  • Loading branch information
santib committed Jul 4, 2023
1 parent 89b820b commit 3831d83
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,10 @@ class Application < Rails::Application
config.middleware.use ActionDispatch::Session::CookieStore
config.middleware.use ActionDispatch::Flash
config.middleware.use Rack::MethodOverride

# Log N+1s using Rails strict_loading feature
ENV['DISABLE_RAILS_STRICT_LOADING'] ||= 'true' if defined?(Rails::Console)
config.active_record.strict_loading_by_default = ENV['DISABLE_RAILS_STRICT_LOADING'] != 'true'
config.active_record.action_on_strict_loading_violation = :log
end
end

0 comments on commit 3831d83

Please sign in to comment.