Upgrade to Rails 6.0 and apply new framework defaults
This commit is contained in:
@ -1,9 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'code_ocean/config'
|
||||
|
||||
return unless CodeOcean::Config.new(:code_ocean).read[:prometheus_exporter][:enabled] && !defined?(::Rails::Console)
|
||||
return if %w[db: assets:].any? { |task| Rake.application.top_level_tasks.to_s.include?(task) }
|
||||
|
||||
# Add metric callbacks to all models
|
||||
ApplicationRecord.include Prometheus::Record
|
||||
ActiveSupport.on_load :active_record do
|
||||
include Prometheus::Record
|
||||
end
|
||||
|
||||
# Initialization is performed in config/application.rb
|
||||
|
Reference in New Issue
Block a user