Added active_record_query_trace

This can be used to track down where queries originate from, regardless
of whether they're caused by N+1 problems or not. This can be enabled by
setting the environment variable ENABLE_QUERY_TRACE to a non-empty value
(e.g. "true").
This commit is contained in:
Yorick Peterse 2015-10-13 17:21:15 +02:00
parent fa3d7db390
commit 7971ed5dac
3 changed files with 8 additions and 0 deletions

View File

@ -225,6 +225,7 @@ group :development do
gem 'rack-mini-profiler', '~> 0.9.0', require: false
gem 'rerun', '~> 0.10.0'
gem 'bullet', require: false
gem 'active_record_query_trace', require: false
# Better errors handler
gem 'better_errors', '~> 1.0.1'

View File

@ -17,6 +17,7 @@ GEM
activesupport (= 4.1.12)
builder (~> 3.1)
erubis (~> 2.7.0)
active_record_query_trace (1.5)
activemodel (4.1.12)
activesupport (= 4.1.12)
builder (~> 3.1)
@ -788,6 +789,7 @@ PLATFORMS
DEPENDENCIES
RedCloth (~> 4.2.9)
ace-rails-ap (~> 2.0.1)
active_record_query_trace
activerecord-deprecated_finders (~> 1.0.3)
activerecord-session_store (~> 0.1.0)
acts-as-taggable-on (~> 3.4)

View File

@ -0,0 +1,5 @@
if ENV['ENABLE_QUERY_TRACE']
require 'active_record_query_trace'
ActiveRecordQueryTrace.enabled = 'true'
end