Commit 5b043801 authored by Stan Hu's avatar Stan Hu

Only prepend Marginalia comments in production mode

Prepending the comment prevents color coding from working in the
development log.
parent 86c6c6a2
...@@ -8,7 +8,11 @@ require 'marginalia' ...@@ -8,7 +8,11 @@ require 'marginalia'
# query. Prepending the comment allows us to trace the source of the # query. Prepending the comment allows us to trace the source of the
# query without having to increase the `track_activity_query_size` # query without having to increase the `track_activity_query_size`
# parameter. # parameter.
Marginalia::Comment.prepend_comment = true unless Rails.env.test? # Some tests do string matching against raw SQL #
# We only enable this in production because a number of tests do string
# matching against the raw SQL, and prepending the comment prevents color
# coding from working in the development log.
Marginalia::Comment.prepend_comment = true if Rails.env.production?
Marginalia::Comment.components = [:application, :controller, :action, :correlation_id, :jid, :job_class] Marginalia::Comment.components = [:application, :controller, :action, :correlation_id, :jid, :job_class]
# As mentioned in https://github.com/basecamp/marginalia/pull/93/files, # As mentioned in https://github.com/basecamp/marginalia/pull/93/files,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment