mirror of https://github.com/rails/rails
Only try to configure the query log tags if Active Record is present
This commit is contained in:
parent
a6aa9376f1
commit
ac77ab469f
|
@ -96,7 +96,11 @@ module ActionController
|
|||
end
|
||||
|
||||
initializer "action_controller.query_log_tags" do |app|
|
||||
if app.config.active_record.query_log_tags_enabled && app.config.action_controller.log_query_tags_around_actions != false
|
||||
query_logs_tags_enabled = app.config.respond_to?(:active_record) &&
|
||||
app.config.active_record.query_log_tags_enabled &&
|
||||
app.config.action_controller.log_query_tags_around_actions
|
||||
|
||||
if query_logs_tags_enabled
|
||||
app.config.active_record.query_log_tags += [:controller, :action]
|
||||
|
||||
ActiveSupport.on_load(:action_controller) do
|
||||
|
|
|
@ -58,7 +58,11 @@ module ActiveJob
|
|||
end
|
||||
|
||||
initializer "active_job.query_log_tags" do |app|
|
||||
if app.config.active_record.query_log_tags_enabled && app.config.active_job.log_query_tags_around_perform != false
|
||||
query_logs_tags_enabled = app.config.respond_to?(:active_record) &&
|
||||
app.config.active_record.query_log_tags_enabled &&
|
||||
app.config.active_job.log_query_tags_around_perform
|
||||
|
||||
if query_logs_tags_enabled
|
||||
app.config.active_record.query_log_tags << :job
|
||||
|
||||
ActiveSupport.on_load(:active_job) do
|
||||
|
|
Loading…
Reference in New Issue